- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to calculate percentage by each group
Hi all,
I have a dataset which consists of the data as shown on the below table "Table -1" , however, I would like to show the data in the power bi dashboard as shown on "Table - 2" where each role_Status were calculated for each Region in percentage wise. I have tried to add measure column for each role status and used if query to count as 1 if there is value in the Role_status or else show blank, then use the sum function to count all the 1s on each role_status and then use matrix visualization and use role_status on value but I'm unable to represent this data as per table 2 . Any help on this would be greatly appriciated.
Table -1
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do this without code. Put your data into a matrix visual and show values as percentage of column total.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @biswad ,
You can create a measure as below to get it, please find the details in the attachment.
Percentage =
VAR _region =
SELECTEDVALUE ( 'Table'[Region] )
VAR _count =
CALCULATE (
COUNT ( 'Table'[Brand] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Region] = _region )
)
VAR _bcount =
COUNT ( 'Table'[Brand] )
RETURN
DIVIDE ( _bcount, _count )
Best Regards
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @biswad ,
You can create a measure as below to get it, please find the details in the attachment.
Percentage =
VAR _region =
SELECTEDVALUE ( 'Table'[Region] )
VAR _count =
CALCULATE (
COUNT ( 'Table'[Brand] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Region] = _region )
)
VAR _bcount =
COUNT ( 'Table'[Brand] )
RETURN
DIVIDE ( _bcount, _count )
Best Regards
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@v-yiruan-msft that is the perfect solution to my problem, lots of thing to learn, much appriciated you help. I will accept as a solution friend.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do this without code. Put your data into a matrix visual and show values as percentage of column total.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
09-23-2024 09:01 AM | |||
05-08-2024 01:23 AM | |||
12-28-2023 05:57 AM | |||
01-15-2024 06:45 AM | |||
07-31-2024 10:39 PM |