Forum Discussion
adriancho_BI
2 years agoRegular Visitor
Create Categories
Hi! I need your help. I'm trying to create a category measure, where the column I'm referencing has numers from 0 to 1. I'm trying to create a category every 25% like ranges. I cant't manually grou...
- 2 years ago
Hi, if the measure is needed, please check the below picture and the attached pbix file.
Category % measure = IF ( HASONEVALUE ( data[id] ), SWITCH ( TRUE (), SUM ( data[value] ) = 0, "0%", SUM ( data[value] ) <= 0.25, ">0 -25%", SUM ( data[value] ) <= 0.5, ">25 -50%", SUM ( data[value] ) <= 0.75, ">50 -75%", SUM ( data[value] ) <= 1, ">75-100%" ) )
adriancho_BI
2 years agoRegular Visitor
It's a great aproximation of how my data looks like, something a I forgot to write, is that I'm working in Direct Query mode, where the creating custom column function is a litle restricted.
Jihwan_Kim
2 years agoSuper User
Hi, if the measure is needed, please check the below picture and the attached pbix file.
Category % measure =
IF (
HASONEVALUE ( data[id] ),
SWITCH (
TRUE (),
SUM ( data[value] ) = 0, "0%",
SUM ( data[value] ) <= 0.25, ">0 -25%",
SUM ( data[value] ) <= 0.5, ">25 -50%",
SUM ( data[value] ) <= 0.75, ">50 -75%",
SUM ( data[value] ) <= 1, ">75-100%"
)
)