Reply
alexcatala
Helper IV
Helper IV
Partially syndicated - Outbound

Calculate Total weekly from daily figures

Hi,

 

I am trying to obtain the weekly QTY based on the daily QTY.

 

I would like to be able to extract the weekly QTY by store.

 

alexcatala_0-1620403092967.png

 

As you can see I have the daily QTY, store and the week number. So I would like to add an extra column or measure to know the total QTY per week and per store.

 

Any suggestion?

 

Thanks for your time

1 ACCEPTED SOLUTION

Syndicated - Outbound

Hi @alexcatala ,

 

In that case, please use following formula:

Weekly Qty = CALCULATE( SUM(Sheet1[Qty]), ALLEXCEPT(Sheet1, Sheet1[Year], Sheet1[Week], Sheet1[Store]))

dkaushik_0-1620415478942.png

 

 

Thanks,

Dheeraj

View solution in original post

5 REPLIES 5
dkaushik
Resolver II
Resolver II

Syndicated - Outbound

Hi @alexcatala ,

 

Try this, 

Weekly Qty = sumx(filter(Sheet1, [store] =earlier(Sheet1[Store]) && [week] =earlier([week])),[Qty])

dkaushik_0-1620408627939.png

 

Regards,

Dheeraj

Please mark as Solution if it works 🙂

Syndicated - Outbound

Hi @dkaushik 

 

alexcatala_0-1620410499491.png

It is a closer answer but the problem is the year, it is counting the total from all years, instead of per year.

 

Any idea?

amitchandak
Super User
Super User

Syndicated - Outbound

@alexcatala ,In a table/matrix or any visual. Take un summarized week column and sum(table[Qty]), you will week wise data. 

 

new measure = sum(table[Qty])

Or Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Weekly Qty as column = sumx(filter(Table, [store] =earlier([store]) && [week] <earlier([week])),[Qty])

 

But measure in visual is a better idea

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Syndicated - Outbound

Hi @amitchandak 

 

alexcatala_0-1620404662924.png

After adding your suggestion this is what appeared.

 

It doesn't match the total number it should. It is inaccurate. For the 1st example if avg daily is 300 it should be around 2.100, but no 109.074.

 

Any suggestion?

Syndicated - Outbound

Hi @alexcatala ,

 

In that case, please use following formula:

Weekly Qty = CALCULATE( SUM(Sheet1[Qty]), ALLEXCEPT(Sheet1, Sheet1[Year], Sheet1[Week], Sheet1[Store]))

dkaushik_0-1620415478942.png

 

 

Thanks,

Dheeraj

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)