Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FoolzRailer
Helper I
Helper I

Group data in intervals

Hello 

I have a column containing the depth of several nodes, which I would like to group in intervals in a report. Is this possible or do I need to do some DAX calculation first? 

 

Basically as shown below, so the report should only show that on the right hand side. 

 

Depthinterval.png

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@FoolzRailer , Create a new column like

Switch(true(),
[Depth] <=1 , " 0-1",
[Depth] <=2, " 1-2",
[Depth] <=3 , "2-3"
)

 

and then take sum "number of" or count of "number of" in the visual with this new column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

@amitchandak 

 

Perfect, if I have empty values it is currently added to the interval 0-1, how do I make it so the blank/empty cells are also empty/blank in the new Interval Column? 

 

Edit: 

Figured out the Blank handling. 

 

DybdeInterval = Switch(true();
Knude[Dybde] = Blank(); Blank();
Knude[Dybde] <1 ; "0-1";
Knude[Dybde] <2; "1-2";
Knude[Dybde] ❤️ ; "2-3")
 
How do I make sure it doesn't count negative values? Right now Negative values are counted in 0-1 group, can you have two different conditions in a group?
 
Edit 2:
Think I figured out how to handle negative values, let me know if my syntax is wrong. 
 
DybdeInterval = Switch(true();
Knude[Dybde] = Blank(); Blank();
Knude[Dybde] >0 && Knude[Dybde] < 1; "0-1";
Knude[Dybde] >0 && Knude[Dybde] <2; "1-2";
Knude[Dybde] >0 && Knude[Dybde] < 3 ; "2-3";
Knude[Dybde] >0 && Knude[Dybde] <4 ; "3-4")

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@FoolzRailer , Create a new column like

Switch(true(),
[Depth] <=1 , " 0-1",
[Depth] <=2, " 1-2",
[Depth] <=3 , "2-3"
)

 

and then take sum "number of" or count of "number of" in the visual with this new column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

 

Perfect, if I have empty values it is currently added to the interval 0-1, how do I make it so the blank/empty cells are also empty/blank in the new Interval Column? 

 

Edit: 

Figured out the Blank handling. 

 

DybdeInterval = Switch(true();
Knude[Dybde] = Blank(); Blank();
Knude[Dybde] <1 ; "0-1";
Knude[Dybde] <2; "1-2";
Knude[Dybde] ❤️ ; "2-3")
 
How do I make sure it doesn't count negative values? Right now Negative values are counted in 0-1 group, can you have two different conditions in a group?
 
Edit 2:
Think I figured out how to handle negative values, let me know if my syntax is wrong. 
 
DybdeInterval = Switch(true();
Knude[Dybde] = Blank(); Blank();
Knude[Dybde] >0 && Knude[Dybde] < 1; "0-1";
Knude[Dybde] >0 && Knude[Dybde] <2; "1-2";
Knude[Dybde] >0 && Knude[Dybde] < 3 ; "2-3";
Knude[Dybde] >0 && Knude[Dybde] <4 ; "3-4")

@FoolzRailer , Thanks for posting the solution finally worked. Sorry I saw this late. Marking your replay as a solution too. 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.