Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
In a matrix, I need to show below measures for each column.
| coln 1 | measure 2 |
| coln 2 | Average(coln4) |
| coln 3 | Max(Coln4) |
I tried using below measure but I get error. Please help to get the write DAX.
Measure 1 =
SWITCH (
SELECTEDVALUE( Table[coln 1] ), Measure 2,
SELECTEDVALUE( Table[coln 2] ), AVERAGE ( coln4 ),
SELECTEDVALUE ( Table[coln 3] ), MAX ( coln4 )
)
What does your 'Table' look like?
You need to use true/false (yes/no) questions in your SWITCH, for example:
Measure 1 =
SWITCH (
SELECTEDVALUE( Table[coln] ) = "coln 1", [Measure 2],
SELECTEDVALUE( Table[coln] ) = "coln 2", AVERAGE ( coln4 ),
SELECTEDVALUE ( Table[coln] ) = "coln 4", MAX ( coln4 )
)
Can you provide more detail on what you're trying to acheive?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@meena16_vibrant Thanks - can you make your dummy data a bit more meaningful? I can't see why you have two rows with almost the same data and why that same data needs to be the trigger for a different measure. Can you simply do three measures:
AAA = [measure1]
BBBB = AVERAGE(table[coln4])
CCC = MAX(table[coln4])
And add those three measures to a matrix or table visual?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 106 | |
| 39 | |
| 33 | |
| 25 |