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, 2020 in Power BI by vnk
• 390 points
1,014 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, 2020 by Gitika
• 65,870 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,550 points
332 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,930 points
144 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,550 points
430 views
0 votes
1 answer

how to write dax calculation Power bi

Hi, @vnk You can make use of this ...READ MORE

answered Aug 5, 2020 in Power BI by code_Damon
168 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,220 points

edited Oct 11, 2018 by Kalgi 842 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
• 52,310 points
356 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
16,780 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
• 52,310 points
28,981 views
0 votes
1 answer

DAX Calculation the Max for a Group.

You can try this out:  Desired Output=CALCULATE(MAX([Check]), ...READ MORE

answered Sep 24, 2020 in Power BI by Gitika
• 65,870 points

edited Sep 25, 2020 by Gitika 1,119 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, 2020 in Power BI by Gitika
• 65,870 points
803 views