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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
bhalicki
Helper V
Helper V

Matrix, Measures, ISINSCOPE and Totals

Hi,

 

I want to customise the total in a matrix visualisation (instead of showing a count, I want to show the count and percentage of total count - as a string).  Is there a way to use ISINSCOPE with a switch statement to tell if the total row is in scope and therefore use a specific calculation?

bhalicki_0-1647080270140.png

Thanks,

Ben.

 

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

Hi @bhalicki ,

 

You may try these Measures.

 

CountStatus =
VAR AllStatus =
    CALCULATE ( COUNT ( 'Table'[Status] ), ALL ( 'Table' ) )
VAR Status_ =
    COUNT ( 'Table'[Status] )
VAR StatusPer =
    FORMAT ( Status_ / AllStatus, "#%" )
VAR RowTotal =
    SWITCH (
        TRUE (),
        NOT ( ISINSCOPE ( 'Table'[Status] ) ),
            Status_ & "," & StatusPer,
        Status_
    )
RETURN
    IF (
        HASONEFILTER ( 'Table'[ProjectDesc] ),
        RowTotal,
        Status_ & "," & StatusPer
    )

 

 

Then, the result should look like this.

vcazhengmsft_0-1647323390012.png

 

Also, attached the pbix file as reference.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @bhalicki ,

 

You may try these Measures.

 

CountStatus =
VAR AllStatus =
    CALCULATE ( COUNT ( 'Table'[Status] ), ALL ( 'Table' ) )
VAR Status_ =
    COUNT ( 'Table'[Status] )
VAR StatusPer =
    FORMAT ( Status_ / AllStatus, "#%" )
VAR RowTotal =
    SWITCH (
        TRUE (),
        NOT ( ISINSCOPE ( 'Table'[Status] ) ),
            Status_ & "," & StatusPer,
        Status_
    )
RETURN
    IF (
        HASONEFILTER ( 'Table'[ProjectDesc] ),
        RowTotal,
        Status_ & "," & StatusPer
    )

 

 

Then, the result should look like this.

vcazhengmsft_0-1647323390012.png

 

Also, attached the pbix file as reference.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

tamerj1
Super User
Super User

Hi @bhalicki 

you can use 

IF ( NOT HASONEVALUE ( Table[ProjectDesc ), your calculation)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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