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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX to switch from one measure to another in the Matrix

Hi Community..!!
I want to write a DAX to switch between one measure to another in the Matrix Visual.

Please refere the below image.

Slicer

ppatil_1-1652424846515.png

Matrix Visual

ppatil_2-1652424890863.png

When I select Average in the slicer then it should show only Average in the Matrix , When I select Number in the slicer then it should show only Number in the Matrix and When I select Select all option in the slicer then it should show both Average and Number  in the Matrix.
Could u please help me to do that? 

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

Hi @Anonymous ,

According to your description, I create a sample, only the values can be filtered by the slicer but the title can't.

Here's my solution.

Average =
IF (
    SELECTEDVALUE ( Slicer[Slicer] ) IN { "Average", "Select-all" },
    AVERAGE ( 'Table'[Sales] ),
    BLANK ()
)
Number =
IF (
    SELECTEDVALUE ( Slicer[Slicer] ) IN { "Number", "Select-all" },
    COUNT ( 'Table'[Sales] ),
    BLANK ()
)

 Get the result.

vkalyjmsft_0-1652946406369.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

According to your description, I create a sample, only the values can be filtered by the slicer but the title can't.

Here's my solution.

Average =
IF (
    SELECTEDVALUE ( Slicer[Slicer] ) IN { "Average", "Select-all" },
    AVERAGE ( 'Table'[Sales] ),
    BLANK ()
)
Number =
IF (
    SELECTEDVALUE ( Slicer[Slicer] ) IN { "Number", "Select-all" },
    COUNT ( 'Table'[Sales] ),
    BLANK ()
)

 Get the result.

vkalyjmsft_0-1652946406369.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank U @v-yanjiang-msft 

Arul
Super User
Super User

@Anonymous ,

Calculation groups should help you for this scenario. You can try to create calculation groups for your scenarion by following the steps mentioned in the following blog post.

https://data-mozart.com/mastering-dp-500-exam-creating-calculation-groups/ 

 

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors