The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have problem with previous month dax. I want to show last month sales revenue based on the slicer, but when I select year of 2022 and month in February, this 'last month' card should display the sum of revenue in January but it shows ((blank)).
I tried to change the year to 2021 and it worked fine.
Below the captures:
I already have 2 tables, 1 table is for data and another 1 for calendar, below are my codes:
last month = CALCULATE (
SUM('190222'[daily_revenue]),
PREVIOUSMONTH ( 'Calendar'[Date].[Date] ) )
And this is the table relationship:
This is the result when I tried to change the year to 2021:
Please help if there is something that I skipped to make it error. Thanks in advance!
Solved! Go to Solution.
@bimagty Well, make sure you have a separate date table and that it is marked as a date table. Also, you don't need the .[Date] portion. Alternatively, just say no to DAX time "intelligence" functions.
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
@bimagty Well, make sure you have a separate date table and that it is marked as a date table. Also, you don't need the .[Date] portion. Alternatively, just say no to DAX time "intelligence" functions.
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Thank you Greg, it is solved.
I marked the table which contains date as date table, and the result is ok now.
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
32 | |
15 | |
12 | |
12 | |
7 |