dax calculation for last N days

0 votes
statusdate

23/06/2020 (today date)

22/06/2020

20/06/2020

19/06/2020

18/06/2020

how to write a dax cal for Last N days

for example: user select last 3 days

output:  19/06/2020

             18/06/2020

              -------------
Jun 24 in Power BI by vnk
• 310 points
54 views

1 answer to this question.

0 votes

Hi, @Vnk,

Regarding your above query, you can follow something like this:

Var Last_Date = LASTDATE( Table name[Date])

Return

CALCULATE( [Total Transaction], 

Filter(All (Dates),

 Dates[Date]> Last_Date = N && 

Dates[Date] <= Last_Date)) 
answered Jun 30 by Gitika
• 32,770 points

Related Questions In Power BI

0 votes
1 answer

Dax code for calculated columns

I would recommend you to adjust the ...READ MORE

answered Oct 22, 2018 in Power BI by Hannah
• 18,060 points
203 views
0 votes
1 answer

Show orders from past n days in Power BI?

HI banu, Create a column like below, diff = ...READ MORE

answered Apr 8, 2019 in Power BI by Cherukuri
• 32,460 points
65 views
0 votes
0 answers

DAX Calculations for dynamically changing value

2 requirements: please help below scenarios I HAVE ...READ MORE

Dec 3, 2019 in Power BI by anonymous
• 18,060 points
153 views
0 votes
0 answers

how to write dax calculation Power bi

ID, Name,Stausdate 1,A,6/8/2020 2,B,6/7/2020 3,C,6/6/2020 4,D,6/5/2020 -------------------- ---------------- How to Create a DAX CAlculation ...READ MORE

Jun 10 in Power BI by vnk
• 310 points
44 views
+3 votes
2 answers

Combine tables in Power BI

You can also achieve this using a ...READ MORE

answered Oct 5, 2018 in Power BI by lina
• 8,200 points

edited Oct 11, 2018 by Kalgi 556 views
0 votes
1 answer

Power Bi Dax Table

You need to wrap the numbers in ...READ MORE

answered Oct 5, 2018 in Power BI by Kalgi
• 51,890 points
231 views
0 votes
2 answers

Power BI Dax Multiple IF AND Statements

HI I have Column Patient 12 13 14 15 18 IN Patient=12, 13 Out ...READ MORE

answered May 22, 2019 in Power BI by VNK
14,329 views
0 votes
1 answer

Distinct count filtered by condition using Power BI Dax

Try this, it should work: DistinctCountActiveMonths = CALCULATE( ...READ MORE

answered Oct 5, 2018 in Power BI by Kalgi
• 51,890 points
20,507 views
0 votes
1 answer

last 10 days data based on Date&time

Hi, @Vnk, Regarding your query, you have to ...READ MORE

answered Jun 4 in Power BI by Gitika
• 32,770 points
137 views
0 votes
1 answer

calculation of hourly dax

Hi, @Vnk, Regarding your above query, you can ...READ MORE

answered 6 days ago in Power BI by Gitika
• 32,770 points
80 views