Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Group by Data Ranges

Hi All,

 

Need a little assistance with what I presume will require a DAX query.

 

I currently have a column named 'Charging State' with different values of battery levels ranging from 0% to 40%.

 

However, I would like to create a visualization that helps with grouping the data in the column into ranges in this format 0 - 10%. 11 - 20%, 21 - 30%, and 31 - 40%.

 

When I started writing this post I had in my mind that I would have to query a new column to assign those values in the relevant rows... I decided to create a New Measure with these DAX query, but can't still get anything meaningful from it: 

 

Measure =
SWITCH (
MIN ( 'Table'[Column2]),
1, CALCULATE (COUNTA('Unusual charging states_1(1684)'[Charging state]),FILTER ( 'Unusual charging states_1(1684)', ('Unusual charging states_1(1684)'[Charging state] > 0.00 && 'Unusual charging states_1(1684)'[Charging state] <= 0.10 ))),
2, CALCULATE (COUNTA('Unusual charging states_1(1684)'[Charging state]),FILTER ( 'Unusual charging states_1(1684)', ('Unusual charging states_1(1684)'[Charging state] > 0.10 && 'Unusual charging states_1(1684)'[Charging state] <= 0.20 ))),
3, CALCULATE (COUNTA('Unusual charging states_1(1684)'[Charging state]),FILTER ( 'Unusual charging states_1(1684)', ('Unusual charging states_1(1684)'[Charging state] > 0.20 && 'Unusual charging states_1(1684)'[Charging state] <= 0.30 ))),
4, CALCULATE (COUNTA('Unusual charging states_1(1684)'[Charging state]),FILTER ( 'Unusual charging states_1(1684)', ('Unusual charging states_1(1684)'[Charging state] > 0.30 && 'Unusual charging states_1(1684)'[Charging state] <= 0.40 ))))

 

Therefore my question is...how possible can I create a Group range slicer/selector to simplfy my large chunk of data values?

 

Thanks all 

 

konstantinos Sean 

  • Hi, Anonymous 

     

    This seems similar to the case of age grouping, you can refer to my response in the following thread.

    Dynamic Grouping of Data in Visual Columns using Age(Values on X Axis) Slicer

     


    If this doesn't cover your case, please consdier sharing more details about it and posting expected result so it is clear on what needs to be implemented?  And It would be great if there is a sample file without any sesentive information here.  It makes it easier to give you a solution.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Hi, Anonymous 

     

    This seems similar to the case of age grouping, you can refer to my response in the following thread.

    Dynamic Grouping of Data in Visual Columns using Age(Values on X Axis) Slicer

     


    If this doesn't cover your case, please consdier sharing more details about it and posting expected result so it is clear on what needs to be implemented?  And It would be great if there is a sample file without any sesentive information here.  It makes it easier to give you a solution.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.