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
rkkumar79
Regular Visitor

DAX formula for Cumulative Supply

Hi,

I am new to powerbi.need help on below.
Need a DAX formula for Cumulative supply as mentioned below.

 

Cumulative supply formula to be
1st Jan = Supply
2nd Jan = Cumm Sales till previous day+2nd Supply
3rd Jan = Cumm Sales till previous day+3rd Supply
4th Jan = Cumm Sales till previous day+4th Supply
and so on.

 

DateSupplySalesC.SalesC.Supply
01-Jan25202025
02-Jan1042430
03-Jan952933
04-Jan1083739
05-Jan2274459
06-Jan004444
07-Jan1595359
08-Jan996262
09-Jan006262
10-Jan1287074
1 ACCEPTED SOLUTION
memepu
Resolver II
Resolver II

Hi @rkkumar79 ,

Please have a try.

Create a measure.

Measure =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Date] <= SELECTEDVALUE ( 'Table'[Date] ) )
)

 

Or a column.

column = 
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER ( ( 'Table' ), 'Table'[Date] <= EARLIER( ( 'Table'[Date] ) )
)
)

 

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best regards.

View solution in original post

2 REPLIES 2
memepu
Resolver II
Resolver II

Hi @rkkumar79 ,

Please have a try.

Create a measure.

Measure =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Date] <= SELECTEDVALUE ( 'Table'[Date] ) )
)

 

Or a column.

column = 
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER ( ( 'Table' ), 'Table'[Date] <= EARLIER( ( 'Table'[Date] ) )
)
)

 

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best regards.

daXtreme
Solution Sage
Solution Sage

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.

Top Solution Authors