Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all,
I've created a 100% stacked chart that is split across 3 clinics (i.e. Clinic as the Axis). I would like to have a 4th column that shows the overall split (i.e. one does not take into consideration the clinic). How can I go about achieving this?
Current visual:
Data table:
Day | Clinic | Type | Color |
1 | A | Dog | Brown |
1 | B | Dog | Brown |
1 | B | Dog | Brown |
2 | A | Dog | White |
2 | B | Dog | White |
2 | C | Cat | Grey |
3 | B | Cat | Grey |
3 | C | Cat | Grey |
4 | A | Cat | Black |
4 | A | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
4 | C | Cat | Black |
Solved! Go to Solution.
Hi @Anonymous ,
What you can do is to create a disconnected with the clinics and total:
Clinic + total = UNION(DISTINCT('Table'[Clinic]),ROW("Clinic","Total"))
Now add the following measure:
Percentage of type =
IF (
SELECTEDVALUE ( 'Clinic + total'[Clinic] ) = "Total",
DIVIDE (
COUNT ( 'Table'[Type] ),
CALCULATE ( COUNT ( 'Table'[Type] ), ALL ( 'Table'[Type] ) )
),
DIVIDE (
CALCULATE (
COUNT ( 'Table'[Type] ),
FILTER (
ALL ( 'Table'[Clinic] ),
'Table'[Clinic] = SELECTEDVALUE ( 'Clinic + total'[Clinic] )
)
),
CALCULATE (
COUNT ( 'Table'[Type] ),
FILTER (
ALL ( 'Table'[Clinic] ),
'Table'[Clinic] = SELECTEDVALUE ( 'Clinic + total'[Clinic] )
),
ALL ( 'Table'[Type] )
)
)
)
Use this measrue for your visualization
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Anonymous ,
What you can do is to create a disconnected with the clinics and total:
Clinic + total = UNION(DISTINCT('Table'[Clinic]),ROW("Clinic","Total"))
Now add the following measure:
Percentage of type =
IF (
SELECTEDVALUE ( 'Clinic + total'[Clinic] ) = "Total",
DIVIDE (
COUNT ( 'Table'[Type] ),
CALCULATE ( COUNT ( 'Table'[Type] ), ALL ( 'Table'[Type] ) )
),
DIVIDE (
CALCULATE (
COUNT ( 'Table'[Type] ),
FILTER (
ALL ( 'Table'[Clinic] ),
'Table'[Clinic] = SELECTEDVALUE ( 'Clinic + total'[Clinic] )
)
),
CALCULATE (
COUNT ( 'Table'[Type] ),
FILTER (
ALL ( 'Table'[Clinic] ),
'Table'[Clinic] = SELECTEDVALUE ( 'Clinic + total'[Clinic] )
),
ALL ( 'Table'[Type] )
)
)
)
Use this measrue for your visualization
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
117 | |
101 | |
71 | |
61 |