Forum Discussion
Dividing on condition (DAX)
- 6 years ago
Hi Anonymous
Please try this measure:
Percentage = DIVIDE(SUM('Ordertime lookup'[tijd min]),SUM('geschatte tijd'[geschatte tijd in min]))You need to use SUM function to calculate the sum total of the values before you use them in the DIVIDE function.
Then you can change the measure's format to Percentage by Measure tools -> Formatting.
Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
- Anonymous6 years ago
Dear v-jingzhang
in each case I didn't have any problem with it when I added it to my dashboard.
Now that you have the sample data maybe you can also help me with a question I'm currently dealing with.
I'm trying to show the average % value of the previous calculation.
But to my understanding you can't look at a measurement, because it's not specified as a column.
So i thought maybe I can show the average value with the following code
I thought maybe by dividing the unique row count of the table I would get the average value.
But my Excel sheets shows another value:
Do you know a solution for this (or how I need to modify the dax code)?
Greetings,
SRMulti
Anonymous
I'm glad that my reply is helpful to you.
For your question, measures work the same no matter what tables they are created in. So when we use a measure in DAX code, we usually use it as [Measure Name], but when we use columns, we need to use them as 'Table Name'[Column Name] to specify which table a column is from. So I guess my code didn't work probably because the table name or column name I used in my code is not the same as yours so the column couldn't be found in your tables?
Best regards,
Jing
Dear v-jingzhang
in each case I didn't have any problem with it when I added it to my dashboard.
Now that you have the sample data maybe you can also help me with a question I'm currently dealing with.
I'm trying to show the average % value of the previous calculation.
But to my understanding you can't look at a measurement, because it's not specified as a column.
So i thought maybe I can show the average value with the following code
I thought maybe by dividing the unique row count of the table I would get the average value.
But my Excel sheets shows another value:
Do you know a solution for this (or how I need to modify the dax code)?
Greetings,
SRMulti
- Anonymous6 years agoNot applicable
I just realised that if I don't click an 70X-XXXID value it will show me the average value.
So consider this question as if I didn't ask it.