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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Graphs on Matrix

I have order numbers, sub order numbers, planned time and actual time for each sub order. 1 order having multiple sub orders. I want to find count of orders where, summation of actual time is greater than summation of planned time. There are thousands of entries for orders.

 

In other words, I want pivot table of my data and then using that result i want to plot graphs. I want to do it using Dax.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can use "SUM" function in Dax to calculate summation of planned time/ actual time. I create a sample to have a test.

1.png

Measure:

 

Count of Orders Sum of Actual time > Sum of Planned time = 
VAR _T =
    SUMMARIZE (
        'Table',
        'Table'[Order numbers],
        "Planned time Duration", CALCULATE ( SUM ( 'Table'[Planned time] ) ),
        "Actual time Duration", CALCULATE ( SUM ( 'Table'[Actual time] ) )
    )
RETURN
    COUNTAX (
        FILTER ( _T, [Actual time Duration] > [Planned time Duration] ),
        [Order numbers]
    )

 

In my sample, only "Order 2" 's summation of actual time is greater than summation of planned time. So measure should return 1. Result is as below. 

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

You can use "SUM" function in Dax to calculate summation of planned time/ actual time. I create a sample to have a test.

1.png

Measure:

 

Count of Orders Sum of Actual time > Sum of Planned time = 
VAR _T =
    SUMMARIZE (
        'Table',
        'Table'[Order numbers],
        "Planned time Duration", CALCULATE ( SUM ( 'Table'[Planned time] ) ),
        "Actual time Duration", CALCULATE ( SUM ( 'Table'[Actual time] ) )
    )
RETURN
    COUNTAX (
        FILTER ( _T, [Actual time Duration] > [Planned time Duration] ),
        [Order numbers]
    )

 

In my sample, only "Order 2" 's summation of actual time is greater than summation of planned time. So measure should return 1. Result is as below. 

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Not very clear. In the visual like bar, you can explore small multiple 

 

or I matrix you try add trend line (sparklines) etc -https://community.powerbi.com/t5/Quick-Measures-Gallery/SVG-Sparklines-Line/td-p/486271

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

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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