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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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