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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
tomaszes19
Frequent Visitor

Matrix to display specific measure for each row if condition met

Hi All,

I would like to create a matrix where one measure will be displayed only for one row [name], so I have 4 different measures in 4 rows:
Matrix

 Dates....
Row for Name A Values for Measure 1
Row for Name BValues for Measure 2
Row for Name CValues for Measure 3
Row for Name DValues for Measure 4


I am able to do it with SWITCH() and SELECTEDVALUE() functions, but it does not work exactly as I want it to.
When I put TRUE() as first argument in SWITCH() function, it only shows 2 rows and when I change it to FALSE() it shows to other rows.
Here is a formula I use:

 

Selected ES code =
SWITCH(
TRUE(),
SELECTEDVALUE('Table1'[NamesColumn]) == "Name A", [Measure 1],
SELECTEDVALUE('Table1'[NamesColumn]) == "Name B", [Measure 2],
SELECTEDVALUE('Table1'[NamesColumn]) == "Name C", [Measure 3],
SELECTEDVALUE('Table1'[NamesColumn) == "Name D", [Measure 2],
BLANK()
)

 

Can anybody help?

2 REPLIES 2
amitchandak
Super User
Super User

@tomaszes19 , Assuming  Namescolumn is used in visual

 

try like

 

Selected ES code =

Sumx(Values('Table1'[NamesColumn), calculate(
SWITCH(
TRUE(),
max('Table1'[NamesColumn]) = "Name A", [Measure 1],
max('Table1'[NamesColumn]) = "Name B", [Measure 2],
max('Table1'[NamesColumn]) = "Name C", [Measure 3],
max('Table1'[NamesColumn) = "Name D", [Measure 2],
BLANK()
) ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

It turned out I made a mistake in the called measures... Sorry and thank you for your time!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.