Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
i need some help in understanding why my dax measure only returns blank rows for my rolling total as soon as i add my clause to stop if Period[DATE]= TODAY()-1
my tables are joined on Period[Datekey] = Sales[DimDatekey]
This returns a correct running total but includes ofcourse days which have no sales since it goes further than my last sale date.
Solved! Go to Solution.
@Reaper1337 , Test as
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-7,Day))
O
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date])-1 ,-7,Day))
O
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-7,Day))
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max('Date'[Date]) -1 ,-7,Day))
To get the best out of the time intelligence function. Make sure that you have a date calendar and that it has been marked as the date in the model view. Also, join her with the date column of your events. See :radacad sqlbi My Video Series Appreciate your congratulations.
@Reaper1337 , Test as
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-7,Day))
O
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date])-1 ,-7,Day))
O
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-7,Day))
Rolling 7 days ? CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max('Date'[Date]) -1 ,-7,Day))
To get the best out of the time intelligence function. Make sure that you have a date calendar and that it has been marked as the date in the model view. Also, join her with the date column of your events. See :radacad sqlbi My Video Series Appreciate your congratulations.
@Anonymous
Can you try the following measure
IF(
isblank([Sales Volume]), blank(),
CALCULATE([Sales Volume],DATESINPERIOD(Period[Date],max(Period[Date])-1,-7,DAY))
)
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |