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
Hey there,
Try to calculate the previous month production. Although I already add one column for 'YearandMonth' (year*100+month) in whole number format, but it still doesn't work. I think my logic is correct, but it always shows zero...just no idea what's wrong with that dax? Would you help to check? Thanks!
Solved! Go to Solution.
Hi @naoyixue1
Try this,
Last Month Production=Calculate([Produced Qty],Filter(ALL('Time Lookup'),'Time Lookup'[YearandMonth]=Selectedvalue('Time Lookup'[YearandMonth])-1))
If the problem is still not solved, it indicates that your formula seems to be OK, so maybe there's something wrong with your measure.
Can you provide more details about your data model and table structure, or PBI sample file after removing sensitive information? It will help to work out the solution quickly.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @naoyixue1
Try this,
Last Month Production=Calculate([Produced Qty],Filter(ALL('Time Lookup'),'Time Lookup'[YearandMonth]=Selectedvalue('Time Lookup'[YearandMonth])-1))
If the problem is still not solved, it indicates that your formula seems to be OK, so maybe there's something wrong with your measure.
Can you provide more details about your data model and table structure, or PBI sample file after removing sensitive information? It will help to work out the solution quickly.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi,
If you have a Calendar set up with a proper relationship to your base data table and your slicer is from the Calendar table, then this simple measure should work
=calculate([product qty],previousmonth(calendar[date]))
Ensure that you select a Year/Month in the slicer.
Hope this helps.
Hey Ashish Mathur,
Thanks. But I'm now dealing with the non standard calendar...That's why I cannot use that previousmonth dax to calculate. Thanks!
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 |
---|---|
93 | |
85 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
132 | |
110 | |
66 | |
55 |