Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Minimum product : Min(Data[Index])
Min Prod Value=
Data[Base]*CALCULATE((Data[Qty]),FILTER(Data,Data[Index]=MIN(Data[Index])))
"quantity (-) minimum prod value for ex: (10.0*02=0.2)
Need to consider the output of this previous row result (*) qty Ex: (0.2*0.03=0.006)
Formula: 10*0.02=0.2
0.2*0.03=0.006
0.006*0.04=0.00024
0.00024*0.05=0.000012
Solved! Go to Solution.
Hi @RuchiSharma ,
I suggest you to try code as below to create a calculated column.
Output =
VAR _MinProdValue =
Data[Base]
* CALCULATE (
SUM ( Data[Qty] ),
FILTER ( Data, Data[Index] = MIN ( Data[Index] ) )
)
RETURN
IF (
Data[Index] = MIN ( Data[Index] ),
_MinProdValue,
CALCULATE (
PRODUCT ( Data[Qty] ),
FILTER ( Data, Data[Index] <= EARLIER ( Data[Index] ) )
) * Data[Base]
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RuchiSharma ,
I suggest you to try code as below to create a calculated column.
Output =
VAR _MinProdValue =
Data[Base]
* CALCULATE (
SUM ( Data[Qty] ),
FILTER ( Data, Data[Index] = MIN ( Data[Index] ) )
)
RETURN
IF (
Data[Index] = MIN ( Data[Index] ),
_MinProdValue,
CALCULATE (
PRODUCT ( Data[Qty] ),
FILTER ( Data, Data[Index] <= EARLIER ( Data[Index] ) )
) * Data[Base]
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-rzhou-msft - What if Index is a date (I think it should work similar since it gives it order) AND also a column with different products (product A, B, C) and this is needed at a per product basis? how would you modify your code to accomodate?
Thank you so much for spending time on the solution @v-rzhou-msft it's working fine.❤😊
User | Count |
---|---|
77 | |
77 | |
67 | |
65 | |
47 |
User | Count |
---|---|
108 | |
105 | |
93 | |
83 | |
65 |