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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
corbusier
Advocate IV
Advocate IV

Show Week-over-Week % increase in Matrix visual?

Hi all, I'm trying to show the Week-over-week % increase in a Matrix visualization. I created two Measures for each Metric I want to show, one for Last week, and one for Current week. 

 

Adding this to the Matrix visual, however, is very kludgy and not suitable for what I want. If I remove the Column Grand Totals, the % increase also disappears. It is also very cumbersome to create these measures for each metric. Is there a better way? 

 

CurrWeekUsers = CALCULATE(SUM(data_source[users]), FILTER(google_analytics_4weeks, data_source[week_num]=WEEKNUM(NOW() )))
PreWeekUsers = CALCULATE(SUM(data_source[users]), FILTER(google_analytics_4weeks, data_source[week_num]=WEEKNUM(NOW() )-1))
% Change = ([CurrWeekUsers]  - [PreWeekUsers] )  / [PreWeekUsers]

Capture-pbi-users.PNG

3 REPLIES 3
GilbertQ
Super User
Super User

Hi there

 

What I would suggest doing is to put all your measures into one measure and then debug them using the variables. You can watch this video by Adam and Marco who explain how to do the debugging.

 

https://www.youtube.com/watch?v=9SV2VnYbgg4 

 

I would also suggest creating a Date table, as this makes Time Intelligence measures work.

You can find details on how to create it from my blog post here: https://www.fourmoo.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fi...

 

Then below is the measure that I created on my Google Analytics and it works as expected.

 

% Weekly Change =
VAR ThisWeekDate =
    WEEKNUM ( TODAY ()2 )
VAR LastWeekDate =
    WEEKNUM ( TODAY ()2 ) - 1
VAR ThisYear =
    YEAR ( TODAY () )
VAR CurrWeekUsers =
    CALCULATE (
        [Users],
        FILTER (
            'Date',
            'Date'[Week Number of Year] = ThisWeekDate
                && 'Date'[Calendar Year] = ThisYear
        )
    )
VAR PrevWeekUsers =
    CALCULATE (
        [Users],
        FILTER (
            'Date',
            'Date'[Week Number of Year] = LastWeekDate
                && 'Date'[Calendar Year] = ThisYear
        )
    )
VAR PercChange =
    DIVIDE ( ( CurrWeekUsers - PrevWeekUsers )PrevWeekUsers )
RETURN
    PercChange




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Thank you Gilbert, could you show an example of a chart or matrix visual using this measure? How does it look? For example, in mine, I'd like to display the last 4 weeks but only show the % change once, for the last 2 weeks. 

Hi there

Could you please explain how you would want to display the last 4 weeks but only show the % change for the last 2 weeks?

Would this all be on one matrix?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors