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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Rajeshree
New Member

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
v-rzhou-msft
Community Support
Community Support

Hi @Rajeshree ,

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
v-rzhou-msft
Community Support
Community Support

Hi @Rajeshree ,

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

@Rajeshree , 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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.