I've been working on some rolling 12 months graphs. Most things are working well, but when diving into the details there's always something not working as expected.
Top matrix show the R12 revenues for different products. And bottom table shows revenue per month and R12 revenues for the choosen product. My problem is that it doesn't show the R12-value for months with 0 revenue.
If I choose the setting "show information wihtout data", then I achieve this, which is not what I want
My current measure:
Solved! Go to Solution.
I tried with this:
I tried with this:
@Puttsson , if you use period/month from a date table in visual
and use measure like
CALCULATE([Revenue Sum Switch],
Yes, thanks @amitchandak , exactly, that solves one part as I wrote, but creates another issue.
The reason why I don't want it for future months is because I want to show R12 on historical data (Revenue R12), then a prognosis for the future data, which is a separate measure. This separate measaure is done with ISBLANK, and only shown when Revenue R12 is empty.
You could add an IF statement around your calculation to check for future months
Revenue R12 = VAR _MaxDate = MAX(DimDate[Date]) VAR _LastCompleteMonth = EOMONTH(TODAY(), -1) VAR _Result = IF( _MaxDate <= _LastCompleteMonth, CALCULATE([Revenue Sum Switch], DATESINPERIOD(DimDate[Date],max(DimDate[Date]),-12,MONTH) ), BLANK() ) RETURN _Result
Looks like the one that I posted 🙂
Using LASTDATE(ALL(vFactRM[RevenueDate])) instead of yours
_LastCompleteMonth = EOMONTH(TODAY(), -1)
since last month is dynamic. Could be June, or could be May as of today.
, CALCULATE([Revenue Sum Switch],DATESINPERIOD(DimDate[Date],max(DimDate[Date]),-12,MONTH)))
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!