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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
angem
New Member

DAX Percentage of actions completed on time

Good Afternoon (Newbie here)

I'm trying to create a card for my dashboard that shows percentage (% value only) of actions completed on time.

So far I have created a claulated column for the completed on time, however there are blanks that appear in the result as being completed on time which need to be excluded from the count.

I was thinking i might nest the ALLNOBLANK function in the current if statement, but i'm a tad lost in the next steps. 

This is the current Dax I have in Power Bi

= IF('Corrective Actions'[Action - Date Due]>=('Corrective Actions'[Action - Date Completed]),"yes",if('Corrective Actions'[Action - Date Due]<=('Corrective Actions'[Action - Date Completed]),"No"))

 

Any guidace to this would be great as a pie chart with filters is not the ideal visual I'm seeking.

angem_0-1716353795356.png

I'd like to contidionally format the percentage card value based on it's value ranges

Thank you in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @angem ,

I would suggest that you create measures instead of calculated columns. I created a sample data to help you with your problem, you can try adding the following measures.

Sample data:

vyifanwmsft_0-1716441747710.png

Add new measures:

Yes = 
VAR TotalActions =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
VAR CompletedTimely =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        'Corrective Actions'[Action - Date Due] >= 'Corrective Actions'[Action - Date Completed],
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
RETURN
    DIVIDE ( CompletedTimely, TotalActions )
No = 
VAR TotalActions =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
VAR CompletedUntimely =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        'Corrective Actions'[Action - Date Due] <= 'Corrective Actions'[Action - Date Completed],
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
RETURN
    DIVIDE ( CompletedUntimely, TotalActions )

Final output:

vyifanwmsft_1-1716441888121.png

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

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
angem
New Member

Very much appreciate your guidance here Ada, thank you!! What a great way to start the week, your DAX solved my questions above.

Regards

Ange

Anonymous
Not applicable

Hi @angem ,

I would suggest that you create measures instead of calculated columns. I created a sample data to help you with your problem, you can try adding the following measures.

Sample data:

vyifanwmsft_0-1716441747710.png

Add new measures:

Yes = 
VAR TotalActions =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
VAR CompletedTimely =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        'Corrective Actions'[Action - Date Due] >= 'Corrective Actions'[Action - Date Completed],
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
RETURN
    DIVIDE ( CompletedTimely, TotalActions )
No = 
VAR TotalActions =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
VAR CompletedUntimely =
    CALCULATE (
        COUNTROWS ( 'Corrective Actions' ),
        'Corrective Actions'[Action - Date Due] <= 'Corrective Actions'[Action - Date Completed],
        NOT ( ISBLANK ( 'Corrective Actions'[Action - Date Completed] ) )
    )
RETURN
    DIVIDE ( CompletedUntimely, TotalActions )

Final output:

vyifanwmsft_1-1716441888121.png

How to Get Your Question Answered Quickly - Microsoft Fabric Community

If it does not help, please provide more details with your desired out put and pbix file without privacy information.

 

Best Regards,

Ada Wang

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

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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