Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
This is what I'm tyring to get to:
I have tried a DAX measure that puts the max date in a variable (to get the slicer's date) and then in another variable the date seven days prior to that (using a an index on the date table minus 7), and returns a calculation that takes my Actuals between those two dates:
Last 7 days) =
VAR FilteredDate = MAX('Dimension Date'[Date])
VAR DateIncrementMinus7 = CALCULATE(MAX('Dimension Date'[Daily Increment]), ALL('Dimension Date') ,'Dimension Date'[Date] = FilteredDate) - 7
VAR FilteredDateMinus7 = CALCULATE(MAX('Dimension Date'[Date]), ALL('Dimension Date') ,'Dimension Date'[Daily Increment] = DateIncrementMinus7)
RETURN
CALCULATE([Actual], 'Dimension Date'[Date] <= FilteredDate, 'Dimension Date'[Date] >= FilteredDateMinus7, ALL('Dimension Date'))
But this is not giving me what I want at all. Thanks in advance for your help!
Solved! Go to Solution.
Hi, ok, I've found a solution to my problem.
Here it is for anyone struggling with the same issue:
Hi, ok, I've found a solution to my problem.
Here it is for anyone struggling with the same issue:
@AltGr9 , Try like
Last 7 days =
VAR FilteredDate = MAXX(allselected('Dimension Date') ,'Dimension Date' [Date])
VAR DateIncrementMinus7 = FilteredDate - 7
RETURN
CALCULATE([Actual], filter( ALL('Dimension Date'),'Dimension Date'[Date] <= FilteredDate, 'Dimension Date'[Date] >= DateIncrementMinus7))
or
Last 7 days =
VAR FilteredDate = MAXX(allselected('Dimension Date') ,'Dimension Date' [Date])
VAR DateIncrementMinus7 = FilteredDate - 7
RETURN
CALCULATE([Actual], filter( ('Dimension Date'),'Dimension Date'[Date] <= FilteredDate, 'Dimension Date'[Date] >= DateIncrementMinus7))
If there is order issue with weekday name the use sort column
https://radacad.com/sort-a-column-with-a-custom-order-in-power-bi
Also check this approch
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |