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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
pxb015
Frequent Visitor

Plot measure on horizontal bar chart as Y-axis

Hi, I'm asking for help plotting a measure onto the Y-axis of my horizontal graph in PBI Desktop. Thanks in advance for all responses!

 

I have a table of dates (for the sake of the example I only care about the month and year), objects with an ID, and a column signifying if each object was "on time". For other reasons this column is either "Y" or null. The table below is an example of what I have.

 

DateObject IDOn Time
02/2022abcY
02/2022defnull
03/2022ghiY
03/2022jklY
05/2022mnonull

 

I also have a measure in my dashboard which counts the percentage of "on time" objects vs total objects. The goal of this measure is so that I can see the total percentage of "on time" objects each month. This is my measure:

 

 

PercentCompletedOnTime = FORMAT(ROUND(DIVIDE(Count('Table'[On Time]), Count('Table'[Object ID])), 2), "Percent")

 

 
Now my problem: I want to plot the measure onto a horizontal bar chart by month, but PBI won't let me add the measure to anything other than the tooltips.
 
PBI does allow me to plot the month on the x-axis and the count of object IDs on the y-axis. So I can see total objects each month, good but not what I want. Strangely I'm allowed to add the measure "PercentCompletedOnTime" into the tooltips though. As can be seen in the screenshot below.
 
So if I hover my mouse over the bar, I can see the measure's value for each month. PBI shows me that it can count the value each month, but it won't actually let me make a bar from it. What am I doing wrong?
 
Screenshot 2022-06-22 184241.png
Screenshot 2022-06-22 185618.png
 
What do I need to do to for PBI to allow me to put the "PercentCompletedOnTime" measure into the Y-axis and not the tooltip?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@pxb015 , Create it like

PercentCompletedOnTime = ROUND(DIVIDE(Count('Table'[On Time]), Count('Table'[Object ID])), 2)

 

and mark it as % measure using measure tool

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@pxb015 , Create it like

PercentCompletedOnTime = ROUND(DIVIDE(Count('Table'[On Time]), Count('Table'[Object ID])), 2)

 

and mark it as % measure using measure tool

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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