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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
BakerE
Regular Visitor

Creating a column showing trend of previous week's score vs current week's score

Hello community,

 

I have a BI report that collects data from multiple sources and ranks distributors based on an overall percentage. I have begun to export the data each week to capture that week's overall percentage (Score). I would like to add a DAX formula that will automatically look at the previous week's export - compare that against this week's percentage - and then create a trend arrow based on the result.

 

Example:

 

Distributor 1

Week 13, Overall percentage 45%

Week 14, Overall percentage 52% (current week)

Create a Trend Arrow Up

Distributor 2
Week 13, Overall percentage 88%

Week 14, Overall percentage 73% (current week)

Create Trend Arrow Down

 

The preference would be to have the report auto-calculate the trend arrow based on current week's percentage against last week's percentage. 


Thansk for a response!

2 ACCEPTED SOLUTIONS
Gabry
Super User
Super User

This depends on a variety of factors, and unfortunately, you haven't provided sufficient information. For instance, details such as how the calendar table is structured and the method used to calculate the overall percentage are crucial in determining the appropriate solution for your needs. Without these specifics, it's challenging to offer a tailored solution.

 

It could be as easy as: 

trend =

var prevweek= calculate(youroverallmeasure, calendarweek = selectedvalue(calendarweek)-1)
return
if (youroverallmeasure>prevweek, "up", "down")

View solution in original post

Anonymous
Not applicable

Hi @BakerE ,

 

Thanks @Gabry  for the quick reply and solution. Here is my alternative approach for your reference:

(1)This is my test data.  

vtangjiemsft_0-1712212530705.png

(2)We can create a column.

Trend = 
var _last=CALCULATE(SUM('Table'[percentage]),FILTER('Table','Table'[Distributor]=EARLIER('Table'[Distributor]) && 'Table'[Week]=EARLIER('Table'[Week])-1))
RETURN IF(ISBLANK(_last),BLANK(),IF([percentage]>=_last,"up","down"))

(3)Setting the Conditional Format.

vtangjiemsft_1-1712212666012.png

vtangjiemsft_2-1712212760855.png

 

Best Regards,

Neeko Tang

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

2 REPLIES 2
Anonymous
Not applicable

Hi @BakerE ,

 

Thanks @Gabry  for the quick reply and solution. Here is my alternative approach for your reference:

(1)This is my test data.  

vtangjiemsft_0-1712212530705.png

(2)We can create a column.

Trend = 
var _last=CALCULATE(SUM('Table'[percentage]),FILTER('Table','Table'[Distributor]=EARLIER('Table'[Distributor]) && 'Table'[Week]=EARLIER('Table'[Week])-1))
RETURN IF(ISBLANK(_last),BLANK(),IF([percentage]>=_last,"up","down"))

(3)Setting the Conditional Format.

vtangjiemsft_1-1712212666012.png

vtangjiemsft_2-1712212760855.png

 

Best Regards,

Neeko Tang

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

Gabry
Super User
Super User

This depends on a variety of factors, and unfortunately, you haven't provided sufficient information. For instance, details such as how the calendar table is structured and the method used to calculate the overall percentage are crucial in determining the appropriate solution for your needs. Without these specifics, it's challenging to offer a tailored solution.

 

It could be as easy as: 

trend =

var prevweek= calculate(youroverallmeasure, calendarweek = selectedvalue(calendarweek)-1)
return
if (youroverallmeasure>prevweek, "up", "down")

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.