Forum Discussion
Create Categories Based On Count From a Measure
- 4 years ago
Hi JJ51
Here is a sample file with the solution https://www.dropbox.com/t/X2AzilJNQyYDLliOYou nedd to have a calculated column
Buckets = VAR NumberOfChanges = COUNTROWS ( CALCULATETABLE ( Changelog, ALLEXCEPT ( Changelog, Changelog[Issue #] ) ) ) VAR Result = SWITCH ( TRUE(), NumberOfChanges IN { 1, 2, 3 }, "1-3", NumberOfChanges IN { 4, 5, 6 }, "4-6", NumberOfChanges IN { 7, 8, 9 }, "7-9", NumberOfChanges IN { 10, 11, 12 }, "10-12", NumberOfChanges IN { 13, 14, 15 }, "13-15", ">15" ) RETURN ResultThe the measure would be
Count = DISTINCTCOUNT ( Changelog[Issue #] )
Hi JJ51
Here is a sample file with the solution https://www.dropbox.com/t/X2AzilJNQyYDLliO
You nedd to have a calculated column
Buckets =
VAR NumberOfChanges =
COUNTROWS (
CALCULATETABLE (
Changelog,
ALLEXCEPT ( Changelog, Changelog[Issue #] )
)
)
VAR Result =
SWITCH (
TRUE(),
NumberOfChanges IN { 1, 2, 3 }, "1-3",
NumberOfChanges IN { 4, 5, 6 }, "4-6",
NumberOfChanges IN { 7, 8, 9 }, "7-9",
NumberOfChanges IN { 10, 11, 12 }, "10-12",
NumberOfChanges IN { 13, 14, 15 }, "13-15",
">15"
)
RETURN
ResultThe the measure would be
Count = DISTINCTCOUNT ( Changelog[Issue #] )- JJ514 years agoFrequent Visitor
Thank you! The calculated column did exactly what I needed. However, I substituted the entire NumberOfChanges variable for the measure. The measure was also changed to just a count of Issue# in the Changelog, and due to a relationship between the the two tables (Issue #)
- Anonymous3 years agoNot applicable
Hi,
i'm trying to create a dyanmic category for my measure result which is in percent.but it's not working, it display juste 1 same value for all
Percent Category =VAR Per = [% measure]VAR Result =SWITCH (TRUE(),Per <= 1.10, "0-110%",(Per >= 1.11 && NumberOfChanges < 125), "110-125%",(Per >= 1.26 && NumberOfChanges < 150), "125-150%","150%+")RETURNResultHave you any idea ?- tamerj13 years agoCommunity Champion
Anonymous
Would you please place a screenshot?