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
krzysztof
Helper III
Helper III

Calculation group Add measure LY

I have a problem to add the LY measure in the Tabular Editor, which when selecting kpi “Units” will display the LY function from the measure “Units_LY” and when selecting KPI “Price” will display the measure “Price_LY”
Note: LY function is different for Units and Price measure

 

PBX: https://drive.google.com/file/d/1T5-UIX8LzcGf5gN_Vwl8RMp34dJsEQhk/view?usp=sharing&fbclid=IwAR1xOobI... 

 

1.png

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @krzysztof ,

Please try to create a measure with below dax formula and add it to the table visual

Measure =
VAR cur_kpi =
    SELECTEDVALUE ( 'New Calculation Group'[Name] )
RETURN
    SWITCH ( cur_kpi, "Price", [Price_LY], "Units", [Units_LY] )

Animation16.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
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-binbinyu-msft
Community Support
Community Support

Hi @krzysztof ,

Please try to create a measure with below dax formula and add it to the table visual

Measure =
VAR cur_kpi =
    SELECTEDVALUE ( 'New Calculation Group'[Name] )
RETURN
    SWITCH ( cur_kpi, "Price", [Price_LY], "Units", [Units_LY] )

Animation16.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
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.