Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
All
Below is my data:
SKU - Weight in Kg
SKU1 - 50
SKU2 - 100
SKU3 - 150
SKU4 - 200
If i filter for SKU2 and SKU3, and I create a measure to calculate min weight from filtered row, it will be like this:
SKU - Weight in Kg Min Weight
SKU2 - 100 - 100
SKU3 - 150 -100
But when i create a new column to find the difference in weight, it is taking min weight from the original data.
This is the result i get now:
SKU - Weight in Kg Min Weight - Difference between WEight in Kg and Min Weight
SKU2 - 100 - 100 - 50 (100-50)
SKU3 - 150 -100 100 (150-50)
What i want to get is:
This is the result i get now:
SKU - Weight in Kg Min Weight - Difference between WEight in Kg and Min Weight
SKU2 - 100 - 100 - 0 (100-100)
SKU3 - 150 -100 50 (150-100)
Please assist.
hello, I would use the Min Weight based on ALLSELECTED & a difference with HASONEVALUE to get the current [Weight in Kg]
Min Weight = MINX(ALLSELECTED('Table');'Table'[Weight in Kg])
Difference between WEight in Kg and Min Weight =
VAR __Current_Weight = If(HASONEVALUE('Table'[Weight in Kg]);VALUES('Table'[Weight in Kg]))
RETURN __Current_Weight - [Min Weight]
For second column, the formula used is minx(allselected(table),"weight in kg")
User | Count |
---|---|
41 | |
27 | |
23 | |
19 | |
16 |
User | Count |
---|---|
55 | |
35 | |
21 | |
18 | |
15 |