Forum Discussion
LOD? DAX?
- 4 years ago
Hey Anonymous ,
I think I found the reason. You added the formula as calculated column, but you have to add it as measure:
Then the result is correct:
To understand the difference, a calculated column is just a new column in the table. In your case you added a new column that returned for every row the average of
tableforqty[ONHAND_QTY] what is for each row the same value as the column tableforqty[ONHAND_QTY]. When you put that calculated column in the matrix the visual was summing up the averages, what was equal to the total.If you use a measure it will always be calculated on the fly and in the context that you are using it. So if you put the measure in the matrix, it will calculate the average for each Component_Code and also for the total.You can see the difference also by the logo. The calculated column [On Hand Average] has the icon of a table, the measure [On Hand Average as Measure] has the icon of a measure.If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
You can create a calculated column as shown below
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Anonymous
the data looks like this actually,
my goal is to get the output below:
REQUIRED QUANTITY = ADDING ALL THE ROWS
ON_HAND = calculated field that will only get the minimum/average
shortage = ON_HAND - REQUIRED QUANTITY (TOTAL OF 40)
- Anonymous4 years agoNot applicable
You'll show the final output in table visual?
you can change the calculated column to this
Desired Output = SUM(Sheet1[Required])-Sheet1[On Hand]- Anonymous4 years agoNot applicable
Anonymous still not working. you might want to check the sample file i created.
https://www.dropbox.com/s/bo84cwqa7lpmcha/samplepbi.pbix?dl=0