Forum Discussion
DAX Formula for Percentage
- 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
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