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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kbtmk
Regular Visitor

How to group data into buckets with a measure

Is it possible to group data into price buckets without using a calculated column? 

I have a list of prices and I'd like to write a measure that indicates what "price bucket" they fall in.

Pirce_buckets.pngPrice_List.png

I've tried : 

Price Bucket:=Calculate( LASTNONBLANK(VALUES(Price_Bucket[Price_Bucket]), 1), FILTER(Weekly_Trades, [Pricet]<= [Price Bucket Max] && [Pricet]>[Price Bucket Min]))

 

Where pricet:=Pricet:=MAX(Weekly_Trades[PRICE])

Price Bucket Min:=MIN(Price_Bucket[Min])

Price Bucket Max:=MAX(Price_Bucket[Max])

 

 

But as you can see, it only identifies the price bucket if the price equals the max for the price bucket range. 

1 REPLY 1
v-huizhn-msft
Employee
Employee

Hi @kbtmk,

When you use the formulas your given to get the max and min Price Bucket, which should be persistent. And and there is only one max value and one min value, how do you group the price to different groups?

Price Bucket Min:=MIN(Price_Bucket[Min])
Price Bucket Max:=MAX(Price_Bucket[Max])


Based on your description, I am unable to reproduce your scenario, could you please share 'Price_Bucket' and 'Weekly_Trades' sample data for futher analysis.

In addition, calculate different groups, if is used in calcuculated column.  If you want to create a measure, rether than calculated column, you can use values function in measure. For instance, I have the following sample data. 

1.PNG

Create a measure, create a table, select the [Client_ID] and measure as value level, please see the result shown in screenshot below.

Group-list = IF(VALUES(Table1[Client_ID])=5,"Yes","No")


 2.PNG

Please post more details, I think more information on the way your data is structured would help. Thanks a lot.

Best Regards,
Angelia

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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