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
Anonymous
Not applicable

Cumulative Sales month wise

Hi Guys

here i am facing issue related to Cumulative total values.

this is my cumulative Monthly sales measure 

Cumulative Query for monthlyCumulative Query for monthly

Here, I created Normal matrix and Cumulative matrix.

Normal Matrix & Cumulative MatrixNormal Matrix & Cumulative Matrix

2nd matrix showing sales values are wrong, i mean cumulative matrix may - 20 it's showing zero(0.0M) bcz of orginal matrix have 0 values in may 20.

But i need value in may 20 ->(2366.9M+0.0M) = 2366.9M Cumulative matrix.

 

Cumulative total will showing perfect fine may-20 (2366.9+379.6+4450.1+4545.0+0.0 = 11,741.5), but when coming to month wise it's not showing.

 

regards,

naveen

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can create a measure like this:

Measure =
SUMX (
    SUMMARIZE (
        FILTER (
            ALLSELECTED ( 'DIM_TIME' ),
            'DIM_TIME'[Date] <= MIN ( 'DIM_TIME'[Date] )
                && 'DIM_TIME'[Product] IN DISTINCT ( 'DIM_TIME'[Product] )
        ),
        'DIM_TIME'[Month_Year],
        "MeasureValue", CALCULATE ( [Actual Net flow] )
    ),
    [MeasureValue]
)

The result may be your expected:

Cumulative result.png

 

Here is my sample file that hopes to help you too, please check and try it: Cumulative Sales month wise.pbix 

 

Best Regards,
Yingjie Li

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

 

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can create a measure like this:

Measure =
SUMX (
    SUMMARIZE (
        FILTER (
            ALLSELECTED ( 'DIM_TIME' ),
            'DIM_TIME'[Date] <= MIN ( 'DIM_TIME'[Date] )
                && 'DIM_TIME'[Product] IN DISTINCT ( 'DIM_TIME'[Product] )
        ),
        'DIM_TIME'[Month_Year],
        "MeasureValue", CALCULATE ( [Actual Net flow] )
    ),
    [MeasureValue]
)

The result may be your expected:

Cumulative result.png

 

Here is my sample file that hopes to help you too, please check and try it: Cumulative Sales month wise.pbix 

 

Best Regards,
Yingjie Li

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

 

amitchandak
Super User
Super User

@Anonymous , I ncase you have a date in your table, you can use datesmtd with a date table

example

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

 

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.