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
Amardeep100115
Post Prodigy
Post Prodigy

How to cal calculate previous month Total

Please help me to calculate previous month total with currant month and quarter. Please note it needs be calculate as per fiscal year which starts from Oct 2018 . to access data please visit below link https://1drv.ms/u/s!Ai3rGPgy20kLwRZ0Ci5K07f41wSJ?e=KHVKrm
AB
1 ACCEPTED SOLUTION

Hi @Amardeep100115 

You may check below measure.Create rank and yearmonth column first.

Measure = 
IF (
    ISFILTERED ( sasw[Month] ),
    CALCULATE (
        SUM ( sasw[Total] ),
        FILTER ( ALL ( sasw ), sasw[Rank] = MAX ( sasw[Rank] ) - 1 )
    ),
    SUM ( sasw[Total] )
)

Regards,

Community Support Team _ Cherie Chen
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

6 REPLIES 6
v-cherch-msft
Employee
Employee

Hi @Amardeep100115 

Please use below measure to get the previous month Total.

Measure = 
CALCULATE (
    SUM ( sasw[Total] ),
    FILTER (
        sasw,
        MONTH ( sasw[As of Date] )
            = MONTH ( TODAY () ) - 1
            && YEAR ( sasw[As of Date] ) = YEAR ( TODAY () )
    )
)

Regards,

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

Thanks for your response

 

result should be the total of previous  month, please advice

 

 

ss.JPG


@v-cherch-msft wrote:

Hi @Amardeep100115 

Please use below measure to get the previous month Total.

Measure = 
CALCULATE (
    SUM ( sasw[Total] ),
    FILTER (
        sasw,
        MONTH ( sasw[As of Date] )
            = MONTH ( TODAY () ) - 1
            && YEAR ( sasw[As of Date] ) = YEAR ( TODAY () )
    )
)

Regards,


 

AB

Hi @Amardeep100115 

You may check below measure.Create rank and yearmonth column first.

Measure = 
IF (
    ISFILTERED ( sasw[Month] ),
    CALCULATE (
        SUM ( sasw[Total] ),
        FILTER ( ALL ( sasw ), sasw[Rank] = MAX ( sasw[Rank] ) - 1 )
    ),
    SUM ( sasw[Total] )
)

Regards,

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

One more request.

 

i have added one table in which we i have last 8 month date.

 

I wish to use filter from FY 2019 table and SASW total need to reflect selected month total + Last month total

 

please find the belwo file location

 

 

 

 

https://1drv.ms/u/s!Ai3rGPgy20kLwRdWKMv6sHk5oNQy?e=kxzxY1

AB

Hi @Amardeep100115 

I would suggest you create a new thread on forum so that more community members can see it and provide advice. Please remember to post dummy data and desired result.

Regards,

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

Hi @v-cherch-msft 

 

After updating power BI file and above formula is not working properly.

 

Please suggest

AB

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.