Forum Discussion

svinayagam1984's avatar
5 years ago
Solved

Total not showing for Last week

I am trying to compare the current week vs Last week's data at the account level.

This is the measure that I created to calculate the previous week's revenue.

Last Week =
CALCULATE (
SUM ( Data[MRR] ),
FILTER ( ALLSELECTED( 'Calendar'[WeekEnd] ), 'Calendar'[WeekEnd] = SELECTEDVALUE('Calendar'[WeekEnd] ) - 7))

This works fine gives the result I wanted, But I am not getting the Total. 

Can someone please help me to resolve this?

My Sample file is here:

https://drive.google.com/file/d/1a_esocOUDQFICiCoOuDHStKW74J0te_x/view?usp=sharing 



3 Replies

  • svinayagam1984 try this measure

     

    Last Week new = 
            CALCULATE (
                SUM ( Data[MRR] ),
                DATEADD ( 'Calendar'[Date] , -7, DAY )
            )

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    ⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡

     

     

  • FrankAT's avatar
    FrankAT
    Icon for Community Champion rankCommunity Champion

    Hi svinayagam1984 

    I think you can do it like this:

     

     

    Sum of MRR = SUM(Data[MRR])
    
    Last Week = 
    VAR _SUMLastWeek = CALCULATE([Sum of MRR], DATEADD('Calendar'[Date], -7, DAY))
    RETURN
        if( [Sum of MRR] = BLANK(), BLANK(), _SUMLastWeek )

    With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
    FrankAT (Proud to be a Datanaut)