Forum Discussion
Display Count in Pie Chart based on Condition
- 2 years ago
In case anyone happens to stumble upon this post with the same question, this is the dax I ended up writing to help me figure out this issue:
Measure =
VAR A = CALCULATETABLE(DISTINCT(Table[ID], Table[Class] = "A")
VAR B = CALCULATETABLE(DISTINCT(Table[ID], Table[Class] = "B")
VAR AB = INTERSECT(A, B)RETURN
CALCULATE(COUNTROWS(Table, Table[ID] IN AB)
And then in the visual tab of the pie chart, put this measure under "Values" and put the Class column from the table under "Legend".
In case anyone happens to stumble upon this post with the same question, this is the dax I ended up writing to help me figure out this issue:
Measure =
VAR A = CALCULATETABLE(DISTINCT(Table[ID], Table[Class] = "A")
VAR B = CALCULATETABLE(DISTINCT(Table[ID], Table[Class] = "B")
VAR AB = INTERSECT(A, B)
RETURN
CALCULATE(
COUNTROWS(Table, Table[ID] IN AB)
And then in the visual tab of the pie chart, put this measure under "Values" and put the Class column from the table under "Legend".