Forum Discussion
Anonymous
6 years agoNot applicable
Dividing a Measure into Multiple Categorizations
Hi all, I'm struggling with this graph I'm trying to create, and I could really use some help. This is what my data looks like (just the upper three tables: Products, Entries and Durations). ...
- 6 years ago
Anonymous thanks for the clarification 🙂
I would do it this way (PBIX link )
- Create a disconnected table called Color which has a column Color, with values "X" and "Y"
- Create this measure to use in the clustered column chart:
Measure for Visual = SUMX ( VALUES ( Products[ID] ), IF ( [have an entry], // True if [have an entry] is nonzero VAR HasC = CALCULATE ( [have a duration], Durations[Category] = "C" ) // True if [have a duration] is nonzero when Category = "C" RETURN SUMX ( Color, SWITCH ( Color[Color], "X", IF ( HasC, 0.4, 1 ), "Y", IF ( HasC, 0.6 ) ) ) ) )- Create a column chart with Color[Color] as the Legend and [Measure for Visual] as the measure. Set the colors for X & Y appropriately.
- Result looks something like this:
Regards
Owen
Anonymous
6 years agoNot applicable
HI Anonymous
If ID 288 has three categories just like A, B and C, will the stacked column divid ID =288 to C =60% and A&B =40%?
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Anonymous
Yes, correct!
Even if an entry has a million times 'A' or 'B' and just once 'C', that entry should be marked 40% in color 'X' and 60% in color 'Y'.