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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to use DAX or PowerQuery to create a measure of trend?

Hi All,

If I have Sales per material for a couple of years, I want to know which materials are plummeting and which materials are skyrocketing.

 

I can write something as 
AVERAGE('Last Year Sales/Last Last Year Sales', 'Last Last Year Sales/Last Last Last Year Sales', 'Last Last Last Year Sales/Last Last Last Last Year Sales')

 

Personally believe it is not an effective way to catch trend, anyone has better idea on this?

 

---

 

Hi, sorry if I didn't made myself clear. 

If I have a table like this, how to create a column for sorting purpose to represent trend?

Product Sales-May  Sales-Apr  Sales-Mar  Sales-Feb  Measure of Trend?
Apple5101636Dropping, should rank low
Orange50455553Stable, in the middle
Durian2015179Rising, should rank high
5 REPLIES 5
Anonymous
Not applicable

Hi @Anonymous 

So now your problem is solved? If yes, please provide your solution and mark it so that more people can see it. If it is not resolved, please follow what I said before and provide accurate data and criteria for judging sales trends so that we can continue to deal with the problem for you.

 

Best Regards

Community Support Team _ Ailsa Tao

 

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

Anonymous
Not applicable

Hi @Anonymous 

The data you provided makes me a little puzzled. For Apple, sales should be declining, but in your data ,it display rise ?

Ailsamsft_0-1624516550484.png

Could you provide accurate data and criteria for judging sales trends ? Under what circumstances are considered as rising and under what circumstances are considered as falling.

 

Best Regards

Community Support Team _ Ailsa Tao

 

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

Anonymous
Not applicable

@Anonymous Thanks for pointing out, yes you are right.
Rectified the incorrect description...

amitchandak
Super User
Super User

@Anonymous , The information you have provided is not making the problem clear to me. Can you please explain with an example.

 

If you are looking for averages  of sum

 

averagex(values(Date[Year]), calculate(sum(Table[Values])))

 

rolling average

 

Rolling 2 = CALCULATE(averagex(values(Date[Year]), calculate(sum(Table[Values]))),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-2,Year))


Appreciate your Kudos.


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
Anonymous
Not applicable

Hi, thanks for answer albeit not quite answered the question, have append extra info in the description.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors