Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RuchiSharma
Frequent Visitor

Need to multiply from Previous row result to another column value.

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

RuchiSharma_0-1688554622151.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vrzhoumsft_0-1688698130377.png

 

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.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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.

vrzhoumsft_0-1688698130377.png

 

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 @Anonymous  -  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 @Anonymous it's working fine.❤😊

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.