Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi!
I think I'm going crazy... I made this simple value to calculate the value of last month but the output is BLANK.... What's wrong?
CalcRevenuePrevious = CALCULATE(SUM('table'[Revenue]); PREVIOUSMONTH('table'[YearMonthDate]))
Solved! Go to Solution.
Hi @Anonymous
Do you have a Date Table in your Data model?
For the PREVIOUSMONTH measure to work, you would require having a date table for the Time Intelligence to work correctly.
Here is a link below to create a Date table, after which you can then create a relationship to your 'table'[YearMonthDate]
Can't tell you what is wrong without sample data to recreate. But, note the description of PREVIOUSMONTH from the documentation:
Returns a table that contains a column of all dates from the previous month, based on the first date in the dates column, in the current context.
From:
https://msdn.microsoft.com/en-us/library/ee634758.aspx
So, the first question would be are you sure that the first date in that table in the current context is really the month you want?
PREVIOUSMONTH('table'[YearMonthDate]) alone returns the value I want. My table is aggregated on user-month level with the first date of that month in this column.
Since this part of the formula works, I don't understand why the whole formula doesn't want to return a value.
Going to need to see some sample data to recreate, but I would go with @GilbertQ suggestion of a date table.
Hi @Anonymous
Do you have a Date Table in your Data model?
For the PREVIOUSMONTH measure to work, you would require having a date table for the Time Intelligence to work correctly.
Here is a link below to create a Date table, after which you can then create a relationship to your 'table'[YearMonthDate]
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
86 | |
82 | |
70 | |
49 |
User | Count |
---|---|
143 | |
125 | |
108 | |
60 | |
55 |