Forum Discussion
CALCULATE returns 0 on DATE column
Dear Guys,
I got the request to build two tables. Left-hand side is the count some columns by date and right-hand side is difference between two consequtive months. It looks very good by this solution: PowerBI: Stacked Column Chart using only measures | LinkedIn
Then, I need to reorder the date column in descending order. Let's say that the current date should be the first column. So, I applied this Quick Tips: How to Sort Matrix by Column in Descending Order (biinsight.com) as Reversed RUN_DATE. On the left-hand side table is good, but on the right is not since the CALCULATE logic returns 0 on the calculation for previous month.
Noted that the value for right-hand side is Switch Measure Trend. Basically, just compute diffrence between two months.
As a result, these two tables are the same. However, if I show the previous date, it can compute correctly.
Eventaully, right-hand side table should be difference between two months and column in matrix should be shown in descending order. Do you guys have any suggestions on this?
1 Reply
- V-lianl-msft
Community Support
Hi Anonymous ,
Unfortunately, I couldn't figure out what was wrong.
Could you share the sample pbix with dummy data?
Please remove any sensitive data before uploading.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.