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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.