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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Need help with measure | creating dynamic measure

Hi community, 

 

Pbix file for download --> https://1drv.ms/u/s!Agarkj-fHbLWjgkn-5Cm64lDbHgU?e=wWLi3Z

 

I need help with following measure. I have  to create  categories based on how many  products consumed by ID in seletected period.  So far I create this measure but I cannot use  this measure as category.

 

Test MPU = CALCULATE( COUNT ('Table'[ID ] ) , filter( allselected('Table') ,'Table'[ID ] =max('Table'[ID ]) ))

 

My aim is count the total number  products a customer had and create category for customers had only one, two , three, etc  number of  products.  I want create following visual

 

 

Channa_0-1644958465859.png

 

I tried with columns but it is not  dynamic so I want use measure. I would really appreciate for any given help

 

Many Thanks, C.

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You might have to do dynamic segmenetation

 

measure
NrOfProducts = Count(Table[productid])

new Table
bucket = Generateseries(1,100,1)

new Measure
Countx(filter(Values(Table[ID]), [NrOfProducts] = max(bucket[Value])), [ID])

 

You have plot the this bu series values

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

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

3 REPLIES 3
Anonymous
Not applicable

@amitchandak  Thankyou so much for your help!

amitchandak
Super User
Super User

@Anonymous , You might have to do dynamic segmenetation

 

measure
NrOfProducts = Count(Table[productid])

new Table
bucket = Generateseries(1,100,1)

new Measure
Countx(filter(Values(Table[ID]), [NrOfProducts] = max(bucket[Value])), [ID])

 

You have plot the this bu series values

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

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
Anonymous
Not applicable

Hi @amitchandak  , 

 

One last quick question, If  I have to  create dynmaic  grouping   Like "single product user" and "Multi product user "  then where to write if statement  in above code. 

 

Thanks you so much for your help!

C. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.