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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wisekyn77
New Member

Cummulative sum of previous Months

I am creating a matrix table with name, item ID, Item description on rows. 
Month-Year = FORMAT('Data'[Planned Date],"mmm yyyy") on columns and supply qty in values

Capture.PNG
I want a dax formula which will results in 
customer namevendor item iditem iddescJan-24Feb-24Mar-24
    501015

Since we are in Jan 2024...It will give the sum of of all prior supply qty value that is 5+13+12+20=50.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@wisekyn77 

Try this meaure:

YourMeasure =
IF (
    MONTH ( SELECTEDVALUE ( 'Data'[Planned Date] ) ) = 1,
    CALCULATE ( [Measure], 'Data'[Planned Date] <= MAX ( 'Data'[Planned Date] ) ),
    [Measure]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@wisekyn77 

Try this meaure:

YourMeasure =
IF (
    MONTH ( SELECTEDVALUE ( 'Data'[Planned Date] ) ) = 1,
    CALCULATE ( [Measure], 'Data'[Planned Date] <= MAX ( 'Data'[Planned Date] ) ),
    [Measure]
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors
Top Kudoed Authors