Forum Discussion

Auski's avatar
Auski
Advocate I
3 years ago
Solved

DAX Formula for Percentage

Hi all,   I have an excel formula that I am hoping to have replicated into DAX format for a measure I have created. I'm pretty new to Power BI so looking for some help if possible ðŸ˜¬   The excel ...
  • PhilipTreacy's avatar
    3 years ago

    Hi Auski 

     

    Without seeing your data I'm having some trouble understanding if you want a single value for the calculation, or if you are trying to work out percentages for many rows of data?

     

    Going with just a single calculation, you can try 

     

    Percentage = DIVIDE( SUM(adherence[exceptiondurationsecs]), SUM(adherence[adherenceschedulesecs]) )

     

     

    If you are certain that will result in a number less than 1 then it's easy to do this

     

    Percentage = 1 - DIVIDE( SUM(adherence[exceptiondurationsecs]), SUM(adherence[adherenceschedulesecs]) )

     

     

    which will give you a value between 0 and 1.  You can then format that value as a % by clicking on the measure under the Fields and then from the menu click on % or select Percentage from the drop down in the Formatting section

     

    regards

     

    Phil