The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi ...
I have the below tables in my Power BI...
Fact : Profiles
EmpNo | Name | Status | Gender | Group Age |
emp1 | Name 1 | 0 | M | 51 - 60 |
emp2 | Name 2 | 0 | F | 51 - 60 |
emp3 | Name 3 | 1 | M | 00 - 20 |
emp4 | Name 4 | 1 | M | 00 - 20 |
emp5 | Name 5 | 1 | F | 00 - 20 |
emp6 | Name 6 | 1 | M | 21 - 30 |
emp7 | Name 7 | 1 | F | 31 - 40 |
emp8 | Name 8 | 1 | F | 31 - 40 |
emp9 | Name 9 | 1 | F | 21 - 30 |
emp10 | Name 10 | 1 | M | 41 - 50 |
emp11 | Name 11 | 1 | M | 41 - 50 |
emp12 | Name 12 | 1 | M | 41 - 50 |
emp13 | Name 13 | 1 | M | 21 - 30 |
emp14 | Name 14 | 1 | M | 51 - 60 |
Fact : Occupations
EmpNo | Name | Years of Services | Group Years of Service |
emp1 | Name 1 | 5 | 01 - 05 |
emp2 | Name 2 | 6 | 06 - 10 |
emp3 | Name 3 | 4 | 01 - 05 |
emp4 | Name 4 | 3 | 01 - 05 |
emp5 | Name 5 | 5 | 01 - 05 |
emp6 | Name 6 | 7 | 06 - 10 |
emp7 | Name 7 | 9 | 06 - 10 |
emp8 | Name 8 | 8 | 06 - 10 |
emp9 | Name 9 | 5 | 01 - 05 |
emp10 | Name 10 | 12 | 11 - 15 |
emp11 | Name 11 | 13 | 11 - 15 |
emp12 | Name 12 | 14 | 11 - 15 |
emp13 | Name 13 | 4 | 01 - 05 |
emp14 | Name 14 | 16 | 16 - 20 |
Dimension : Group Age
Index | Group Age |
1 | 00 - 20 |
2 | 21 - 30 |
3 | 31 - 40 |
4 | 41 - 50 |
5 | 51 - 60 |
6 | 61 - 70 |
7 | > 70 |
Dimension : Year of Service
Index | Group Years of Service |
1 | 01 - 05 |
2 | 06 - 10 |
3 | 11 - 15 |
4 | 16 - 20 |
and below is my visualization:
Measure Available :
1) Male Employee
2) Female Employee
3) Active Employee
My question is as below:
1) How can I get the percentage value?
2) How can I add the Total and Percentage for both and display them next to the chart?
Thank you in advance.
Regards,
NickzNickz
1) to get percentage : You can create measure using divide function OR you can add % where you have created percentage measure.
2) You can show total & percentage both as data label of visual to show them in chart .
For (2), you won't be able to do this in a bar chart.
You can add a % of grand total into the "tooltip" slot of the visual, so it will show up as a hover.
For (1), simply use the [Active Employee] measure and add the gender into the "legend" slot.
You can either:
Hi @rbriga ,
I really appreciate your reply.
I was thinking to have like below sample:
I add table/matrix visualization and put the percentages in there. I will also change the table format. That is the best option I can think of.
Can you assist me with how to get the measure for total and percentage values? ...
Regards,
NickzNickz
Assuming you already have the [Active Employee] measure:
Active Employee %=
DIVIDE(
[Active Employee],
CALCULATE([Active Employee], ALLSELECTED('Employee Table Name')
)
CALCULATE([Active Employee], ALLSELECTED('Employee Table Name') will hold the total which includes all your filters, but takes in all age categories (or any other category in 'Employee Table Name') after those filters.
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
7 |