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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
claireamc
New Member

Dynamic Grouping as a Measure

I'm trying to group a column of data (room capacities) through a measure into dynamic banded groups, eg 0-9, 10-19, 20-19 etc using a DAX measures and a capacity reference table, but I just can't seem to get the measure that will find the right results.

 

I'm not seeing the right results and would like to check why this is:

 

First, I'm attempting to represent the column of data as a measure, eg.

2m = SumX('Available Space', 'Available Space'[Final Capacity Estimate 2m]*1)
 
Is this correct?
 
Secondly I have created a reference table of capacity groups as follows:
 
 
CapacityMinMax
0-909
10-191019
20-292029

 

Lastly, I've tried to find a way to created a DAX formula which will allow the first measure to be searched for the number of instances where a piece of data falls between the mins and maxes in the table as so:

Capacity Band 2m = CALCULATE ([2m],
FILTER(VALUES('Available Space'[Final Capacity Estimate 2m]) ,
COUNTROWS(FILTER('Capacity Bands', 'Available Space'[Final Capacity Estimate 2m] >= 'Capacity Bands'[Min] && 'Available Space'[Final Capacity Estimate 2m] < 'Capacity Bands'[Max]))))
 
This doesn't appear to be returning the correct data, and I'm not sure which calculation this is due to. Has anyone ever grouped through a measure like this before?
Some advice or an alternative answer would be extremely helpful.
1 REPLY 1
Mariusz
Community Champion
Community Champion

Hi @claireamc 

 

Try this article.

https://www.daxpatterns.com/dynamic-segmentation/

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.