The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now
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?
Thanks,
Ben.
Solved! Go to Solution.
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.
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
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.
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
Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.
User | Count |
---|---|
37 | |
36 | |
30 | |
29 | |
21 |
User | Count |
---|---|
61 | |
41 | |
32 | |
19 | |
16 |