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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
EmericTms
Frequent Visitor

Power bi : Segment can't filter a matrix due to the measure used for values

Hello, 

I would like your help regarding a configuration I cannot manage to fix.

I created some random data to better explain my problem. 

 

I have these two tables, they are related through the id of the first table :

EmericTms_1-1740757396215.png

 

And I would like to create the matrix below, where the segment "chapter" filters the lines (TDL) of the matrix.

And the measure that gives the matrix values should return : the max Score (1, 2 or 3) or 4 if the company doesn't have a score for the chapter (so if there is no lines in the table associating the chapter to the company), except if the company is "Tesla" and the chapter "1a" or if  the company is "Apple" and the chapter "5b", then it should return 5. 

EmericTms_2-1740757534245.png

 

Thanks to someone help, I could create the matrix with the right values. But with the measure used in the matrix, the segment "Chapter" can't filter the matrix to only show the lines (TDL) corresponding to the filtered chapter. (The filter chapter is coming from another disconnected table that I created to make the matrix work).

 

The tables and current measure are on this power bi :

powerbi test 

 

Does someone knows how I could solve this and make the filter work ? or have another way to achieve the result I want ?

Thank you.

1 REPLY 1
ahmedoye
Responsive Resident
Responsive Resident

Hello, I have used this formula below, try it and if it works for you, kindly mark this as answer to allow anyone with similar challenges find the solution:

Measure 3 =
VAR CalcValue = CALCULATE(MAX(Tableau1[Score]), TREATAS(VALUES(DisconnectedTable[Chapter]), Tableau2[Chapter]))
VAR SelectedChapter = SELECTEDVALUE(DisconnectedTable[Chapter])
VAR SpecialCheck = OR(AND(SELECTEDVALUE(Tableau1[Company]) = "Tesla", SelectedChapter = "1a"),
                        AND(SELECTEDVALUE(Tableau1[Company]) = "Apple", SelectedChapter = "5b"))
VAR BlankCheck = ISBLANK(CalcValue)
VAR FinalCheck = AND(BlankCheck, SpecialCheck)

RETURN SWITCH(TRUE(),
                FinalCheck, 5,
                BlankCheck, 4,
                CalcValue)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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