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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sayali_deshmukh
Helper III
Helper III

Calculated column for Daily values from Cumulative values

Hi,
Need a calculated column for daily values from cumulative values type and category wise. Table is as per below -

TypeCategoryDateCumulativeDaily
DomesticA21-04-20201 
DomesticA10-05-20205 
DomesticA11-05-20209 
DomesticB21-04-202015 
DomesticB22-04-202016 
DomesticB29-04-202032 
DomesticB11-05-202032 
DomesticC21-04-20201 
DomesticC22-04-20201 
DomesticC23-04-20201 
DomesticC24-04-20209 
ExportE21-04-202036 
ExportE22-04-202036 
ExportE25-04-202051 
ExportE26-04-202053 
ExportF27-04-202053 
ExportF28-04-202054 
ExportF29-04-202058 
ExportF30-04-202061 
ExportF01-05-202067 
ExportF02-05-202071 
ExportF03-05-202078 
ExportF04-05-202078 
ExportF05-05-202080 
ExportF06-05-202080 
ExportF07-05-202083 
2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@sayali_deshmukh ,

 

Create two calculate columns using dax as below:

Rank = RANKX(FILTER('Table', 'Table'[Type] = EARLIER('Table'[Type]) && 'Table'[Category] = EARLIER('Table'[Category])), 'Table'[Index], , ASC, Dense)

Column = 
VAR Current_Rank = 'Table'[Rank]
VAR Current_CumulativeDaily = 'Table'[CumulativeDaily]
RETURN
    IF (
        Current_Rank = 1,
        Current_CumulativeDaily,
        Current_CumulativeDaily
            - CALCULATE (
                MAX ( 'Table'[CumulativeDaily] ),
                FILTER (
                    'Table',
                    'Table'[Category] = EARLIER ( 'Table'[Category] )
                        && 'Table'[Type] = EARLIER ( 'Table'[Type] )
                        && 'Table'[Rank] = Current_Rank - 1
                )
            )
    )

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

camargos88
Community Champion
Community Champion

Hi @sayali_deshmukh ,


Try this code:

 

Daily = CALCULATE(SUM('Table'[Cumulative]); FILTER('Table'; 'Table'[Type] = EARLIER('Table'[Type]) && 'Table'[Category] = EARLIER('Table'[Category]) && 'Table'[Date] <= EARLIER('Table'[Date])))
 


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.