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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

How to highlight changed data and compare what's changed from previous week

Hi Everyone,

 

I am looking for ideas to implement something where users can see what's changed over previous week in terms of data. 

For example, let's say I have a table below that shows recent most data. 

 

CategoryPrice

Diamond

45

Gold50
Silver100

 

Let's say, a week before a data was like below. 

CategoryPrice

Diamond

50

Gold100
Silver25

 

So now, how can I show data that includes columns: Category, Price from last week, price this week and then highlight the one that went up in Green, the one that went low, highlight that in red. Basically, I am trying to see ways and ideas to show data points from current week with previous week and highlight what's changed. Any solutions or thoughts would be super helpful, thanks in advance. 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , do you have this week and previous week data in one table with week number or do want to create a snapshot in power bi.

 

If you have both weeks in table, then create a table with unique week year (all) and create a rank in that and try measure like the example

//Say week year table is date

 

Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
measures


This Week = CALCULATE(Average('Table'[price]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(Average('Table'[price]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

You can take a diff.

 

 

In case you need to create a snapshot in power bi

 

refer

https://blog.crossjoin.co.uk/2020/04/13/keep-the-existing-data-in-your-power-bi-dataset-and-add-new-data-to-it-using-incremental-refresh/
https://www.thebiccountant.com/2017/01/11/incremental-load-in-powerbi-using-dax-union/

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

Data:

vangzhengmsft_0-1632448211289.png

1. to create a calculated column(week num):

WeekNum = WEEKNUM('Table'[Date],1)

2. to get the max weeknum with  a  measure:

_Max_WeekNum = CALCULATE(MAX('Table'[WeekNum]),ALL('Table'))

3. to create 2 calculate table(this week, last week):

W1 = FILTER('Table','Table'[WeekNum]=[_Max_WeekNum])
W2 = FILTER('Table','Table'[WeekNum]=[_Max_WeekNum]-1)

4. to show category and price of last week with a table visual

5. to get the price of this week with a measure:

_W1_price = LOOKUPVALUE(W1[Price],W1[Category],MAX('W2'[Category]))

6. to highlight the value with a color measure:

_color = IF(MAX('W2'[Price])<[_W1_price],"green","red")

 

Model:

vangzhengmsft_1-1632448638273.png

Result:

vangzhengmsft_2-1632448684346.png

Please refer to the attachment below for details. Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

Data:

vangzhengmsft_0-1632448211289.png

1. to create a calculated column(week num):

WeekNum = WEEKNUM('Table'[Date],1)

2. to get the max weeknum with  a  measure:

_Max_WeekNum = CALCULATE(MAX('Table'[WeekNum]),ALL('Table'))

3. to create 2 calculate table(this week, last week):

W1 = FILTER('Table','Table'[WeekNum]=[_Max_WeekNum])
W2 = FILTER('Table','Table'[WeekNum]=[_Max_WeekNum]-1)

4. to show category and price of last week with a table visual

5. to get the price of this week with a measure:

_W1_price = LOOKUPVALUE(W1[Price],W1[Category],MAX('W2'[Category]))

6. to highlight the value with a color measure:

_color = IF(MAX('W2'[Price])<[_W1_price],"green","red")

 

Model:

vangzhengmsft_1-1632448638273.png

Result:

vangzhengmsft_2-1632448684346.png

Please refer to the attachment below for details. Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Anonymous
Not applicable

@amitchandak thanks so much for taking the time to share solution. Basically, I dont have a week number but just a date field with value tagged with each row. Can you please suggest how I can calculate in this case.

amitchandak
Super User
Super User

@Anonymous , do you have this week and previous week data in one table with week number or do want to create a snapshot in power bi.

 

If you have both weeks in table, then create a table with unique week year (all) and create a rank in that and try measure like the example

//Say week year table is date

 

Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
measures


This Week = CALCULATE(Average('Table'[price]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(Average('Table'[price]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

You can take a diff.

 

 

In case you need to create a snapshot in power bi

 

refer

https://blog.crossjoin.co.uk/2020/04/13/keep-the-existing-data-in-your-power-bi-dataset-and-add-new-data-to-it-using-incremental-refresh/
https://www.thebiccountant.com/2017/01/11/incremental-load-in-powerbi-using-dax-union/

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors