Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

pjirach_0-1621103383957.png

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. 

pjirach_1-1621103739179.png

Noted that the value for right-hand side is Switch Measure Trend. Basically, just compute diffrence between two months.

pjirach_4-1621104111056.png

 

pjirach_3-1621103945228.png

As a result, these two tables are the same. However, if I show the previous date, it can compute correctly.

pjirach_5-1621104253756.png

 

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 1
V-lianl-msft
Community Support
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.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.