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

Distinct count and use the measure in axis of a visual

Input tableInput table

I have an input as shown ,for each ID there is dynmic calculation of due date as

1) measure1=calculate(sum(FI[Due Date],distinct(FI[ID NO]))
I have another measure which calculates the Time buckets

2)measure2=if(FI[measure1]<=3,"1-3 days",
                if(FI[measure1]>3 && FI[measure1]<=7,"1 week"),
                if(FI[measure1]>7 && FI[measure1]<=14,"1-2 week"),if(FI[measure1]>14 && FI[measure1]<=21,"2-3 week"),
                if(FI[measure1]>21 && FI[measure1]<=45,"1-2 months"))

I have added the distinct count of ID NO in the value section of a column chart, im not able to add measure 2 in the axis of the column chart. What is theworkaround in such situations.
Please note that i cannot add Time Bucket(measure2) as a column because i want the time bucket to be dynamic.( i have added visual level filters like team1=A, team2=B). my measure2 is taking as a tooltip but not as a axis for the column chart
 

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , You need dynamic segmentation using a new table

 

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

 

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

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 
So as you said i did add a new table as shownBucket TableBucket Table

 

for this i have added the measure for count as
1)bucket=countx(filter(values(FI[ID NO]),FI[measure1]>min(bucket[min days]) && FI[measure1]<min(bucket[max days])),distinct(FI[ID NO]))
[measure1=calculate(sum(FI[Due Days]),distinct(FI[ID NO]))

 

Im getting this errorErrorError

But i have a slicer and i take a single ID ,the visual is displaying the correct value. What do i need to do in all ID NO cases.

Anonymous
Not applicable

bucket=countx(filter(values(FI[ID NO]),FI[measure1]>min(bucket[min days]) && FI[measure1]<=max(bucket[max days])),distinct(FI[ID NO]))
Typo for the above message

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.