March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
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:
Date | Revenue | R12 |
2022-01 | 100 | 100 |
2022-02 | 0 | 100 |
2022-03 | 200 | 300 |
2022-04 | 0 | 300 |
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],
DATESINPERIOD(DimDate[Date],max(DimDate[Date]),-12,MONTH) )
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.
Thanks
Hi @Puttsson
You could add an IF statement around your calculation to check for future months
Something like:
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.
,BLANK()
, CALCULATE([Revenue Sum Switch],DATESINPERIOD(DimDate[Date],max(DimDate[Date]),-12,MONTH)))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |