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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
-VIP-
New Member

Bar Chart With Filter To Calculation Values Differently

Hi,

I have machine utilization data with follwoing columns:

ID, Date, Category, Idle Hrs, Work Hrs, Total Hrs, Expected Hrs, Productive Hrs, Non Productive Hrs, Hrly Rate, Total Cost

 

I want to create a bar chart to show Category on X axis and Total Cost on Y axis.

I then want to create a filter so user can select how to calculate Total Cost - wether it is based on Work Hrs or Total Hrs column.

If Work Hrs is selected then:

Non Productive Hrs = Expected Hrs - Work Hrs

Total Cost = Non Productive Hrs x Hrly Rate

If Total Hrs is selected then:

Non Productive Hrs = Expected Hrs - Total Hrs

Total Cost = Non Productive Hrs x Hrly Rate

 

If someone could guide on how to do this, it would be a great help!

Thank you.

2 REPLIES 2
-VIP-
New Member

Thank you @amitchandak for your suggestion.

I shall give this a try and see how it goes..! One other question though, how would the new measure impact the performance? Considering the table may have approx 1million rows?

 

Thanks again.

amitchandak
Super User
Super User

@-VIP- Create a table with those two values Work Hrs and Total Hrs and use as slicer

 

then create a measure

 

Switch(selectedvalue(Slicer[Value]) ,

"Work Hours" , Sum([Expected Hrs]) - Sum([Work Hrs]) ,

 

"TotalHours" , Sum([Expected Hrs]) - Sum([Total Hrs])

)

 

Like an old measure slicer technique

How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.