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

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

Reply
VijayAntonyM
Helper I
Helper I

Need help on DAX measures

Hi Team,

 

Good day,

Need help on DAX measure on below,

Would like to calculate the % of Percentage value based on Experience center, month-year,

 

VijayAntonyM_0-1736767138474.png

 

Need to bring the On-Time % from the total count, 

Ex: Data and Analytics, Dec-2024 total=225

      On-Time: 214, Delayed:11
      Need percentage value on based total and ontime

 

Kindly help

 

regards

M. Vijay Antony

2 ACCEPTED SOLUTIONS

Both solutions should work as expected. Using the sample PBIX file from @Ritaf1983 and adding the formula I initially provided, it is evident that regardless of whether the resolution flag is "on-time" or "delayed," the result remains consistent for each month-year and experience center. The key difference between the approaches is that hers uses three measures, while mine relies on just one.

 

danextian_0-1736773152456.png

 

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

Can you please be more specific of what you really need? We've already provided you the formulas as well as screenshots of the report. Or do you want the same value for all months? If that is the case, please use this formula. Otherwise, please show us your expected result and not jus the data

Pct On-Time = 
// Calculate the total number of On-Time resolutions
VAR _OnTime =
    CALCULATE (
        SUM ( 'table'[count of number] ),
        FILTER (
            ALL ( 'Table'[Resolution Flag], 'Table'[Month-Year] ),
            'table'[resolution flag] = "On-Time"
        )
    ) // Calculate the total number of Delayed resolutions
VAR _Delayed =
    CALCULATE (
        SUM ( 'table'[count of number] ),
        FILTER (
            ALL ( 'Table'[Resolution Flag], 'Table'[Month-Year] ),
            'table'[resolution flag] = "Delayed"
        )
    )
RETURN
    // Calculate the percentage of On-Time resolutions
    DIVIDE (
        _OnTime,
        _OnTime + _Delayed
    )









Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
Ritaf1983
Super User
Super User

Hi @VijayAntonyM 
You can use these 3 measures :

Total_ count = CALCULATE(sum('Table'[Count of Number]),all('Table'[Resolution Flag]))
On_time = CALCULATE(sum('Table'[Count of Number]),'Table'[Resolution Flag]= "On-Time")
%on time = DIVIDE([On_time],[Total_ count])
Ritaf1983_0-1736768747549.png

The pbix is attached

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
danextian
Super User
Super User

hi @VijayAntonyM 

 

Assuming Count of Number is a column

Pct On-Time =
// Calculate the total number of On-Time resolutions
VAR _OnTime =
    CALCULATE (
        SUM ( 'table'[count of number] ),
        'table'[resolution flag] = "On-Time"
    ) // Calculate the total number of Delayed resolutions
VAR _Delayed =
    CALCULATE (
        SUM ( 'table'[count of number] ),
        'table'[resolution flag] = "Delayed"
    )
RETURN
    // Calculate the percentage of On-Time resolutions
    DIVIDE (
        _OnTime,
        _OnTime + _Delayed
    )

 

If Count of Number isn't a column but count of table rows, use COUNTROWS ( 'table' ) instead.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Team,

Please understand , above 2 solutions are not working,

 

Please see the example in simple way,

VijayAntonyM_0-1736770266815.png

Need to find the Ontime % based on Experience center, Month year , Need to count the Number column and find the On-Time %

this value should be displayed in separte column and should be repeated in all rows.

it should also work in even when we inlcude slicers.

 

Regards

M. Vijay Antony

 

Both solutions should work as expected. Using the sample PBIX file from @Ritaf1983 and adding the formula I initially provided, it is evident that regardless of whether the resolution flag is "on-time" or "delayed," the result remains consistent for each month-year and experience center. The key difference between the approaches is that hers uses three measures, while mine relies on just one.

 

danextian_0-1736773152456.png

 

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

HI Team,

 

Thanks for the reply, Please provide the exact DAX formula using below simple data,

VijayAntonyM_0-1736774287992.png

Need to count the Number column.

Need to place the On time % value in all records.

Please provide teh exact formula 

 

Thanks in advance

 

regards

M. Vijay Antony

Can you please be more specific of what you really need? We've already provided you the formulas as well as screenshots of the report. Or do you want the same value for all months? If that is the case, please use this formula. Otherwise, please show us your expected result and not jus the data

Pct On-Time = 
// Calculate the total number of On-Time resolutions
VAR _OnTime =
    CALCULATE (
        SUM ( 'table'[count of number] ),
        FILTER (
            ALL ( 'Table'[Resolution Flag], 'Table'[Month-Year] ),
            'table'[resolution flag] = "On-Time"
        )
    ) // Calculate the total number of Delayed resolutions
VAR _Delayed =
    CALCULATE (
        SUM ( 'table'[count of number] ),
        FILTER (
            ALL ( 'Table'[Resolution Flag], 'Table'[Month-Year] ),
            'table'[resolution flag] = "Delayed"
        )
    )
RETURN
    // Calculate the percentage of On-Time resolutions
    DIVIDE (
        _OnTime,
        _OnTime + _Delayed
    )









Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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