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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Lesle
New Member

Use calculation group in a measure doesn't show same result with calculation group used directly

I create a calucation item "Margin calculation" in a calculation group, if I use it directly in a visual, it works, 

2.jpg1.jpg

But when I use it in measure  

Product Mix rate - common = calculate([Product Mix],'Calculation group'[Calculation group column]="Margin Calculation"),
it showes nothing

3.jfif4.jfif

I don't know what's wrong with the measure, is there any possible causes ? 

4 REPLIES 4
v-jingzhan-msft
Community Support
Community Support

Hi @Lesle 

 

The details is not enough to help troubleshoot this issue. Can you share the DAX expressions of the calucation item "Margin calculation" and [Product Mix]? Is [Product Mix] an explicit measure? Calculation items only apply to measures or explicit measures. 

 

Best Regards,
Jing

Thanks for your reply, here is the DAX of "Margin calculation"
Margin calculation = switch(true(),
selectedvalue('Parameter - Dimension'[Parameter - Dimension Fields])="'Master - Mgmt'[Business Line]",sumx(values('Master - Mgmt'[Business Line]),SELECTEDMEASURE()),
selectedvalue('Parameter - Dimension'[Parameter - Dimension Fields])="'Master - Mgmt'[Product Group]",sumx(values('Master - Mgmt'[Product Group]),SELECTEDMEASURE()),
selectedvalue('Parameter - Dimension'[Parameter - Dimension Fields])="'Master - PC'[Product Area1_keydata]",sumx(values('Master - PC'[Product Area1_keydata]),SELECTEDMEASURE()),
selectedvalue('Parameter - Dimension'[Parameter - Dimension Fields])="'Master - PC'[Product Family_S1]",sumx(values('master - PC'[Product Family_S1]),SELECTEDMEASURE()),
selectedvalue('Parameter - Dimension'[Parameter - Dimension Fields])="'Master - PC'[Product Family_S2_Cube]",sumx(values('master - PC'[Product Family_S2_Cube]),SELECTEDMEASURE()),
selectedvalue('Parameter - Dimension'[Parameter - Dimension Fields])="'Master - PC'[PC name]",sumx(values('Master - PC'[PC name]),SELECTEDMEASURE()),
SELECTEDMEASURE())
 
and "Product Mix", what do you mean by explicit measure? 
Product Mix = ([Rev percentage change])*[Gross Margin CY]

It seems you have used a field parameter in the calculation item. Where do you use this field parameter in the report? Does it filter different item when you see the difference?

I used the field parameter as row of the table, you can see "Parameter - Dimension" in the picture. I wanna realize that the calculation item can SUMX different dimension as per the field I selete in the parameter 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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