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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
neil7722
New Member

Calculate Incremental values from Cumulative column

I have a table with date in yyyymmdd text format. They are always apart by a week (7 days). The other column had cumulative values for Demand. How do I create another column to calculate the incremental value (weekly demand) ?

 

Capture.JPG

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @neil7722,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Vvelarde
Community Champion
Community Champion

@neil7722

 

hi, In Edit Query add a Index Column

 

After That create a new calculated column:

 

Incremental =
VAR Index = Table1[index] - 1
RETURN
    Table1[CurModDem]
        - CALCULATE (
            SUM ( Table1[CurModDem] );
            FILTER ( Table1; Table1[index] = Index )
        )

DDD.png

 

Regards

 

Victor




Lima - Peru

Any way I can do this without the index? I can use the calulate function by with dates. I am able to convert the yyyymmdd to date and substract 7 days from it, but I am not able to convert it back to text format to use it in filter expression

Hi @neil7722,

 

Why do you use it in Text mode? They are dates. Why not using them as dates? It seems Power BI will do an implicit conversion. Please refer to the following example.

Column =
VAR currentDate = [Date]
RETURN
    CALCULATE ( SUM ( [Value] ), FILTER ( Table1, Table1[Date] < currentDate ) )

Calculate_Incremental_values_from_Cumulative_column

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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