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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
szczawekk
New Member

[Calculation Group] showing PY and CY in matrix when one option is selected on slicer

I have simple model fact and comparison (Dim).

Due to performance issue fact was design with duplicated rows. each period has value for (1) CY and (2) PY.
i created calucation group that is calculating value for CY and PY as:

 

 

CY = 
CALCULATE(
    SELECTEDMEASURE(),
    REMOVEFILTERS(Comparison[ComparisonId]),
    Comparison[ComparisonId] = 1
)

 

 


It works but when i add it to matrix as below, when Comparison from dim is selected, then other value is hidden (in this case when CY is selected PY is hidden).

Is there option to force CG to ignore comparison selection? So regardeles slicer selection always CY and PY will be visible? Switching of interaction is not an option due to page requirement and other measures presented in the matrix (CY, PY, delta, % change, calculation related to CY or PY based on selection)
currently when slicer value is selected the other one goes blank

 

szczawekk_0-1737931080978.png

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@szczawekk To ensure that the slicer selection does not affect the visibility of CY and PY, you can try using the ALL function within your calculation group definitions

 

CY =
CALCULATE(
SELECTEDMEASURE(),
ALL(Comparison[ComparisonId]),
Comparison[ComparisonId] = 1
)

PY =
CALCULATE(
SELECTEDMEASURE(),
ALL(Comparison[ComparisonId]),
Comparison[ComparisonId] = 2
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@szczawekk To ensure that the slicer selection does not affect the visibility of CY and PY, you can try using the ALL function within your calculation group definitions

 

CY =
CALCULATE(
SELECTEDMEASURE(),
ALL(Comparison[ComparisonId]),
Comparison[ComparisonId] = 1
)

PY =
CALCULATE(
SELECTEDMEASURE(),
ALL(Comparison[ComparisonId]),
Comparison[ComparisonId] = 2
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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