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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Upali63
Helper II
Helper II

Extract Weekly Sales volume from Daily transaction table

Hi Friends

I am new to power BI

I have two table as shown below. One for the weekly data and otherone for daily transactions. What I want is to make report in my power bi dash board to show weekly information with last column in my report to be based on data from the daily transation table. In that I want price multified by qty to be shown as Turnover in my weekly report. Kindly help me to solve my issue. Thank you

 

Upali63_0-1674473087350.png

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Upali63 ,

 

--1--

In Power Query, select your Daily Table query and go to the Add Column tab > Custom Column. Call it 'Turnover' and use the following calculation:

[Price] * [Qty]

 

--2--

Then create a calendar table in Power Query (many examples online) with a [WeekEndingDate] column. In PQ, you would create it like this:

Date.EndOfWeek([Date], Day.Friday)

Adjusting the 'Day.Friday' argument to the desired first day of the week.

 

--3--

Apply all to the data model and relate:

Calendar[Date] to WeeklyTable[W-End]

Calendar[Date] to DailyTable[Date]

 

--4--

Create a measure for your Turnover value:

_turnover = SUM(DailyTable[Turnover])

 

--5--

In a table visual, add these fields:

Calendar[WeekEndingDate]

WeeklyTable[All columns except [W-End] ]

...and add this measure:

[_turnover]

 

This should do what you want.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Upali63 ,

 

--1--

In Power Query, select your Daily Table query and go to the Add Column tab > Custom Column. Call it 'Turnover' and use the following calculation:

[Price] * [Qty]

 

--2--

Then create a calendar table in Power Query (many examples online) with a [WeekEndingDate] column. In PQ, you would create it like this:

Date.EndOfWeek([Date], Day.Friday)

Adjusting the 'Day.Friday' argument to the desired first day of the week.

 

--3--

Apply all to the data model and relate:

Calendar[Date] to WeeklyTable[W-End]

Calendar[Date] to DailyTable[Date]

 

--4--

Create a measure for your Turnover value:

_turnover = SUM(DailyTable[Turnover])

 

--5--

In a table visual, add these fields:

Calendar[WeekEndingDate]

WeeklyTable[All columns except [W-End] ]

...and add this measure:

[_turnover]

 

This should do what you want.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thanks

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors