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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Irisohyama6
Frequent Visitor

Plotting graph based on measure with slicer

Good day,

 

My data:

LocationEmployeeYN
WellingtonJonY
WellingtonKevinN
WellingtonOisinY
WellingtonIsaacY
WellingtonPatY
New YorkJonN
New YorkKevinY
New YorkOisinY
New YorkIsaacN
CairoJonY
CairoKevinY
CairoOisinN
CairoIsaacY
CairoPatN
CairoDebY
TokyoIsaacY
TokyoPatN
TokyoDeb

Y

 

From this data, I created a measure that count "Y" for each employee:

 

Count Yes = COUNTROWS(FILTER('Table','Table'[YN]="Y"))

 

I put them in a table visual:

Irisohyama6_0-1649295100961.png

From this table I can see how many occurence of "Count Yes". Looks something like this:

Irisohyama6_1-1649295172625.png

From this, I want to plot a graph like this:

Irisohyama6_2-1649295206679.png

For this graph, I want to able to use the slicer where the columns count will change depends on which 'Location'(s) I picked.

Also, I need this chart to be dynamic as I will add data in the future. The max "Count Yes" is 3 now, but it may be 4 for the next data I add in.

 

My attempt:

Because the x-axis depends on the maximun count of the [Count Yes] measure, I created a measure to count the maximum:

 

Count Yes max per Employee = 
MAXX(KEEPFILTERS(VALUES('Table'[Employee])), CALCULATE([Count Yes]))

 

From here, I created another table to generate the range of x-values for the column chart:

 

Table 2 = GENERATESERIES(1,[Count Yes max per Employee],1)

 

Irisohyama6_3-1649295839092.png

From here I got stuck because I don't know how to fill another column with this:

Irisohyama6_4-1649295877214.png

I understand there are multiple ways of doing this. I am open to any solutions. Here is my file

 

Thank you all in advance.

 

 

 

1 ACCEPTED SOLUTION

@Irisohyama6 , You need employee count

Emp Count = Countx(filter(VALUES('Table'[Employee]), [Count Yes] = max(Table2[Value])),[Employee] )
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
amitchandak
Super User
Super User

@Irisohyama6 , a new measure and values from Table 2 should be used in visual

 

Sumx(filter(VALUES('Table'[Employee]), [Count Yes] = max(Table2[Value])),[Count Yes] )

 

 

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


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

Hi @amitchandak ,

 

Thanks for the swift reply. 

 

I created a measure given by you. Somehow I didn't get the result.

Irisohyama6_0-1649301718277.png

 

 

 

@Irisohyama6 , You need employee count

Emp Count = Countx(filter(VALUES('Table'[Employee]), [Count Yes] = max(Table2[Value])),[Employee] )
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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors