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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ZD1
New Member

% change between week 1 and 2

Hi,

 

I would create a measure to work out % change between (% of calls answered - week 1) and (% of calls answered - week 2). Currently I have cards which show both figures seperately. But I'd like to create a card which works out the % change and I've tried using the following measure but doesn't work...

 

% change Last Week vs This week
= SUM('Week 1'[% of Calls Answered] - SUM('Week 2'[% of Calls Answered]
/ SUM('Week 1'[% of Calls Answered]
* 100))

 

can someone help....

 

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @ZD1 ,

Please try like this:

LastWeek =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER ( ALL ( 'Date' ), 'Date'[Week] = MIN ( 'Date'[Week] ) - 1 )
)

%Change = 
VAR t =
    FILTER (
        SUMMARIZE (
            'Date',
            'Date'[Week],
            "Sales_", SUM ( 'Table'[Sales] ),
            "Last", [LastWeek]
        ),
        [Sales_] <> BLANK ()
    )
VAR tt =
    FILTER (
        ADDCOLUMNS (
            t,
            "per", DIVIDE ( [Sales_] - [Last], [Sales_] ),
            "maxweek", MAXX ( t, [Week] )
        ),
        [Week] = [maxweek]
    )
RETURN
    MAXX ( tt, [per] )

4.PNG

You could download the attachment below. If this can't work, can you please share the sample data table and the expected result? Then we will understand clearly.

 

Best Regards,
Xue Ding
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

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @ZD1 ,

Please try like this:

LastWeek =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER ( ALL ( 'Date' ), 'Date'[Week] = MIN ( 'Date'[Week] ) - 1 )
)

%Change = 
VAR t =
    FILTER (
        SUMMARIZE (
            'Date',
            'Date'[Week],
            "Sales_", SUM ( 'Table'[Sales] ),
            "Last", [LastWeek]
        ),
        [Sales_] <> BLANK ()
    )
VAR tt =
    FILTER (
        ADDCOLUMNS (
            t,
            "per", DIVIDE ( [Sales_] - [Last], [Sales_] ),
            "maxweek", MAXX ( t, [Week] )
        ),
        [Week] = [maxweek]
    )
RETURN
    MAXX ( tt, [per] )

4.PNG

You could download the attachment below. If this can't work, can you please share the sample data table and the expected result? Then we will understand clearly.

 

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

Hi @ZD1 ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.

 

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

@ZD1 

You can do with Week Rank and Date calendar. Please refer a related pbix

https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.