Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I have de following data in a visualization:
Category | Date | Measure |
A | 02-2021 | 5,76% |
B | 02-2021 | 65,34% |
C | 02-2021 | 2,71% |
D | 02-2021 | 0,23% |
E | 02-2021 | 3,45% |
F | 02-2021 | 7,20% |
G | 02-2021 | 5,91% |
H | 02-2021 | 9,40% |
TOTAL | 100% |
And if I filter categories A and B, I obtain the following:
Category | Date | Measure |
A | 02-2021 | 8,11% |
B | 02-2021 | 91,89% |
TOTAL | 100% |
But I would like to have this data:
Category | Date | Measure |
A | 02-2021 | 5,76% |
B | 02-2021 | 65,34% |
TOTAL | 71,1% |
How can I do this? I tried using ALL, ALLEXCEPT and ALLSELECTED but I wasn't able to get it.
Thank you!
Solved! Go to Solution.
try it
Measure =
VAR TotVolumen = SUM(table[VOLUMEN])
VAR VolumenPart =
CALCULATE(
SUM(table[VOLUMEN]),
FILTER(
ALLSELECTED(table),
(table[Date] = MAX(table[Date])
)
))
VAR Result_for_ROW = DIVIDE(TotVolumen,VolumenPart)
VAR Result_for_TOTAL =CALCULATE(Result_for_ROW, ALL('Table'[Category]),All(table[Date]))
VAR Result = if(isinscope('Table'[Category]), Result_for_ROW ,Result_for_TOTAL )
RETURN Result
hello !
you should use ALL in your measure
for more details please write you measure which calculate %
Hello,
This is my measure:
Measure =
VAR TotVolumen = SUM(table[VOLUMEN])
VAR VolumenPart =
CALCULATE(
SUM(table[VOLUMEN]),
FILTER(
ALLSELECTED(table),
(table[Date] = MAX(table[Date])
)
))
VAR Result = DIVIDE(TotVolumen,VolumenPart)
RETURN Result
try it
Measure =
VAR TotVolumen = SUM(table[VOLUMEN])
VAR VolumenPart =
CALCULATE(
SUM(table[VOLUMEN]),
FILTER(
ALLSELECTED(table),
(table[Date] = MAX(table[Date])
)
))
VAR Result_for_ROW = DIVIDE(TotVolumen,VolumenPart)
VAR Result_for_TOTAL =CALCULATE(Result_for_ROW, ALL('Table'[Category]),All(table[Date]))
VAR Result = if(isinscope('Table'[Category]), Result_for_ROW ,Result_for_TOTAL )
RETURN Result
I tried but I get the same result.
If I answered at your question please mark topic as resolved 🙂
could you show your datamodel which include tables with Category, Date columns ?
Hello,
it is solved with the ALL, I just needed to use a different tableof Category.
Thanks!
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |