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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
logan_logan
Helper I
Helper I

Weekly growth in trend

Hi,

I saw some DAX for weekly growth from daily sales. However my problem is weekly growth is possible in cards, but when it is in trend(bar growph) along the week column (which is text, like "week-1"), then it doesn't work.

Need help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from adudani and NordicDrow.

 

Hi @logan_logan ,

 

 1.Change date to week of year in Power Query Editor:

vlinhuizhmsft_1-1729579370873.png

 

2.Create simple measures:

WeeklySales = CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Week of Year],'Table'[Product]))
WeeklyGrowth = 
VAR CurrentWeekSales =  CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Week of Year],'Table'[Product]))
VAR PreviousWeekSales = CALCULATE('Table'[WeeklySales], 'Table'[Week of Year]= MAX('Table'[Week of Year]) - 1)
RETURN
IF(NOT ISBLANK(PreviousWeekSales), (CurrentWeekSales - PreviousWeekSales) / PreviousWeekSales, BLANK())

 

3. Sort by week of year:

vlinhuizhmsft_2-1729579483298.png

 

4. The result is as follows:

vlinhuizhmsft_3-1729579571797.png

 

I can't reproduce your problem based on my tests, can you provide some more specific descriptions and screenshots as well as the dax formula you're using, it will help the problem to be solved more quickly.

 

Best Regards,
Zhu
Community Support Team

 

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

View solution in original post

5 REPLIES 5
adudani
Memorable Member
Memorable Member

Hi @logan_logan ,

kindly provide a sample input and output masking sensitive data.

 

Would have to look at the data. typically a date dimension on a daily granuarilty related to the fact table, along with a dateadd measure provides the result. 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash
NordicDrow
Helper I
Helper I

Hi Logan,

You might want to add some more information, but, I think what you want can be solved in the following manner:

In PowerQuery duplicate your date column. Then right click the new column (must be in date format), select transform -> week -> week of year.

Then if you have a stacked column chart, use week of year in x axis, and sum of sales in y axis.
If you have more than one year of data, you will need to also create a Year column with the same method, and either create a hierarchy Year -> Week, use both columns in x axis or create a year&week column (concatenating both valus, so for example week 17 of 2024 would be 202417).

If you need something more complex, you will probably need to group by in a DAX formula and it usually gets pretty complicated.

Hope this helps!

after converting to "week of year" , the column is no longer date format. And my problem strats from there.

I am sharing the file.

https://www.dropbox.com/scl/fi/yo8658fl2he6q91ejeh7x/TEST.pbix?rlkey=mvcql3x40g87cv7xuqsm5vco4&st=ch...

Anonymous
Not applicable

Thanks for the reply from adudani and NordicDrow.

 

Hi @logan_logan ,

 

 1.Change date to week of year in Power Query Editor:

vlinhuizhmsft_1-1729579370873.png

 

2.Create simple measures:

WeeklySales = CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Week of Year],'Table'[Product]))
WeeklyGrowth = 
VAR CurrentWeekSales =  CALCULATE(SUM([Sales]), ALLEXCEPT('Table', 'Table'[Week of Year],'Table'[Product]))
VAR PreviousWeekSales = CALCULATE('Table'[WeeklySales], 'Table'[Week of Year]= MAX('Table'[Week of Year]) - 1)
RETURN
IF(NOT ISBLANK(PreviousWeekSales), (CurrentWeekSales - PreviousWeekSales) / PreviousWeekSales, BLANK())

 

3. Sort by week of year:

vlinhuizhmsft_2-1729579483298.png

 

4. The result is as follows:

vlinhuizhmsft_3-1729579571797.png

 

I can't reproduce your problem based on my tests, can you provide some more specific descriptions and screenshots as well as the dax formula you're using, it will help the problem to be solved more quickly.

 

Best Regards,
Zhu
Community Support Team

 

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

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.