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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bhalicki
Helper II
Helper II

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors