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
AK1234
Frequent Visitor

how to show failed result in matrix hierarchy results ?

Hi,

 

I have created a matrix that has been conditional formatted to show the red and green icons. However, i have added a hiearchy to it and would like to show the red icon (if any) when collapsed.

 

As you can see below it is all green when collapsed:

 

AK1234_0-1616596370948.png

 

However, when expaned there are red icons.

 

AK1234_1-1616596449510.png

Does anyone know how I can show the red when it is collapsed too so we can see the error as soon as we go on the report?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AK1234 ,

Please try to another new measure as below base on the previous measure [Status_Switch]:

Status_Switch =
SWITCH (
    FIRSTNONBLANK ( 'Task Names'[Task], 1 ),
    "111 WH", [111 StatusID],
    "111 RAW", [RAW 111 StatusID],
    "EPR WH", [EPR Status ID],
    "EPR RAW", [RAW EPR Status ID],
    "AVAYA WH", [AVAYA StatusID],
    "AVAYA RAW", [RAW AVAYA StatusID],
    0
)


New Measure =
VAR _tab =
    SUMMARIZE (
        'Task Names',
        'Task Names'[Task NAME],
        'Task Names'[Task],
        "_Count"[Status_Switch]
    )
RETURN
    IF ( SUMX ( _table, [_Count] ) >= 110 )

Best Regards

View solution in original post

8 REPLIES 8
selimovd
Super User
Super User

Hey @AK1234 ,

 

the values are calculated independent of the underlying hierarchy.

You can change that with a measure that behaves differently. But for that you have to give more information, what is the formula behind the KPIs? What does the table look like, how do the relationships look like.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hi Denis,

 

Thank you for your response.

 

I have had to create the below measure using a FIRSTNONBLANK within a SWITCH statement. The results from each is returning  a 1 and a 0 for the appropriate row using a IF statement. So if it is 1 then it si conditional formatted to show red and 0 to show green.

 

AK1234_0-1616664838707.png

The Hierarchy looks like this: 

AK1234_0-1616685989151.png

 

I have tried to use isinscope but as i don't think it works with measure i have created, unless i am doing it wrong? (I am new to pbi so don't fully understand how everything works yet)

 

 

Anonymous
Not applicable

Hi @AK1234 ,

As check the measure you wrote, you are using the FIRSTNONBLANK function, this returns the first value in the column for which the expression has a non blank value. Please check my example below, Task Name T1 (Task aa1 and bb2 as 0, cc1 as 1). The first value of this task that is not blank is aa1(0). When you collapse the matrix,  it will be with green Icon for Task NAME T1. Please check  whether the data in your matrix has the same situation with mine...

yingyinr_1-1616746462531.png

Best Regards

Hi @Anonymous ,

 

thank you for your response.

 

yes my situation is the same as the one you described above. I found that without using FIRSTNONBLANK I was unable to use the hierarchy as it was throwing out an error when expanding.

 

Do you know of anyway I can show the value with the red icon (if there are any in the data) when collapsed and if not then show the green?

Anonymous
Not applicable

Hi @AK1234 ,

Please try to update the formula of your measure as below and check whether it can get your desired result:

Status_Switch =
VAR _char =
    SWITCH (
        FIRSTNONBLANK ( 'Task Names'[Task], 1 ),
        "111 WH", [111 StatusID],
        "111 RAW", [RAW 111 StatusID],
        "EPR WH", [EPR Status ID],
        "EPR RAW", [RAW EPR Status ID],
        "AVAYA WH", [AVAYA StatusID],
        "AVAYA RAW", [RAW AVAYA StatusID],
        0
    )
VAR _tab =
    SUMMARIZE (
        'Task Names',
        'Task Names'[Task NAME],
        'Task Names'[Task],
        "_Count", _char
    )
RETURN
    IF ( SUMX ( _table, [_Count] ) >= 1, 1, 0 )

Best Regards

Hi @Anonymous ,

 

Thank you for your reponse, i really appreciate it.

 

However, it is still showing the green icon (0) when collapsed even though there are red (1) in some of the tasks.

Anonymous
Not applicable

Hi @AK1234 ,

Please try to another new measure as below base on the previous measure [Status_Switch]:

Status_Switch =
SWITCH (
    FIRSTNONBLANK ( 'Task Names'[Task], 1 ),
    "111 WH", [111 StatusID],
    "111 RAW", [RAW 111 StatusID],
    "EPR WH", [EPR Status ID],
    "EPR RAW", [RAW EPR Status ID],
    "AVAYA WH", [AVAYA StatusID],
    "AVAYA RAW", [RAW AVAYA StatusID],
    0
)


New Measure =
VAR _tab =
    SUMMARIZE (
        'Task Names',
        'Task Names'[Task NAME],
        'Task Names'[Task],
        "_Count"[Status_Switch]
    )
RETURN
    IF ( SUMX ( _table, [_Count] ) >= 110 )

Best Regards

Hi @Anonymous ,

 

Thank you for your help! That worked!

Helpful resources

Announcements
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!

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.

Top Solution Authors