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
jake88
Regular Visitor

Two calculated measures not working as intended

I have two calculated measures which aren't quite working as expected:

 

The measures are below: M3Q is the latest forecast round and Key Comparator is the field that we are comparing the M3Q to.

 

M3Q = calculate(sum('PBI DATA'[Value]),'PBI DATA'[Event]="M3Q")/1000000

Key Comparator = CALCULATE(sum('PBI DATA'[Value])/1000000)

 

The issue I'm having is that when I select an event from my slicer, the Key Comparator changes as expected however the M3Q also changes. I think the reason behind this is that some of the key comparator events have less data than the M3Q.

 

For Example:

M3Q and M2Q has data for all fields in the Type column (Opex, Capex, and Revex) but M1Q only has data for Opex. When I select M2Q as the key comparator the M3Q number is correct however when I select M1Q only the Opex data for the M3Q is shown, not the capex and revex.

 

Is there a way to show all the data?

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@jake88,

What columns do you use to create your visual, when you create a table visual as shown in the following screenshot, the M3Q measure will return correct value even if you select M1Q in the Event slicer.
1.JPG

However, if you add Type column in the table visual, when you select M1Q in the Event slicer, the M3Q measure will be evaluated by the current context and changes to a different value, this is an expected behavior. For more details about context, please review this article: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-quickstart-learn-dax-basics/ . If you want to show all data for M3Q, you would need to add two blank rows for M1Q in capex and revex types.
2.JPG3.JPG


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@jake88,

What columns do you use to create your visual, when you create a table visual as shown in the following screenshot, the M3Q measure will return correct value even if you select M1Q in the Event slicer.
1.JPG

However, if you add Type column in the table visual, when you select M1Q in the Event slicer, the M3Q measure will be evaluated by the current context and changes to a different value, this is an expected behavior. For more details about context, please review this article: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-quickstart-learn-dax-basics/ . If you want to show all data for M3Q, you would need to add two blank rows for M1Q in capex and revex types.
2.JPG3.JPG


Regards,
Lydia

Community Support Team _ Lydia Zhang
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.