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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
pacoduabe
Regular Visitor

Complex DAX Expression PRODUCTX nested in SUMX

Hello! i need to create a complex calculated column. Here is the sample data:

IndexStepValue
005
137
266
398
4127

The new column must follow this logic:

Column(0) = Value(0)

Column (1) = Value(1) + 10 · Value(0) · (Step(0) - Step(1))

Column (row = 2) = Value(2) + 10 · Value(1) · (Step(1) - Step(2)) + 10^2 · Value(0) · (Step(1) - Step(2)) · (Step(0) - Step(1))

Column (row = 3) = Value(3) + 10 · Value(2) · (Step(2) - Step(3)) + 10^2 · Value(1) · (Step(2) - Step(3)) · (Step(1) - Step(2)) + 10^3 · Value(0) · (Step(2) - Step(3)) · (Step(1) - Step(2)) · (Step(0) - Step(1))

...

I tried this DAX expression, but I cannot get the current iteration the SUMX. 

 

VAR __Ind = Data[Index]
RETURN
    CALCULATE(
        SUMX(
            FILTER( Data, Data[Index] >= __Ind - 2 && Data[Index] <= __Ind ),
            VAR __i = Data[Index]
            RETURN
                PRODUCTX (                
                    FILTER ( ALL(Data), [Index] <= __i  && [Index] > 0),
                    Data[PreviousTimeStamp] - Data[TimeStamp]  // Replacing __i with [Index] to store the actual iteration of SUMX
                )
        )
    )
1 REPLY 1
amitchandak
Super User
Super User

@pacoduabe , if need recursive calculation, then I doubt you can get it DAX.

 

But it can work with cumulative the earlier can help

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors