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
zabman
Frequent Visitor

Stacked bar chart with dax expression

Hi,

 

I have a (for me) complex DAX expression showing the average hours taken to move a work item out of 'new' status.

I want to have a bar chart that shows the number of work orders that are above 48 hours, and the number that are below (stacked to 100%)
How can I achieve this?

1 REPLY 1
rbriga
Impactful Individual
Impactful Individual

Assuming you have a fact table named 'Fact Orders', a field named "Order Number" and the measure [

Average Hours]:

Assuming you have a fact table named 'Fact Orders', a field named "Order Number" and the measure [

Average Hours]:
Orders over 48 Hours = 
COUNTROWS(
    FILTER(VALUES('Fact Orders'[Order Number]),
    [Average Hours]>48
    )
)

Orders Within 48 Hours = 
COUNTROWS(
    FILTER(VALUES('Fact Orders'[Order Number]),
    [Average Hours]<=48
    )
)
Place those two in a 100% stacked bar chart and you should be good to go.


Place those two in a 100% stacked bar chart and you should be good to go.

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

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.

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.