Forum Discussion
Auski
3 years agoAdvocate I
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 ...
- 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
Auski
3 years agoAdvocate I
Thank you so much PhilipTreacy, that worked perfectly. I combined your DAX statement with an IF statement to give me the exact output needed.
Legend!