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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
paddysellsfruit
Frequent Visitor

Calculate daily maximums across filtered data

Hi there,

Problem

We have slicers to filter by Date hierarchy, Type/Item, Region, Shop, and Seller.

We need to be able to display the total sales as well as daily maximum sales for the chosen filters. 

Displaying the total sales figure is simple on a line chart, however filters don't work on the daily maximum.

When I say daily maximum, I mean the maximum value per day for the sum of sales within that day, even if we have drilled up the date hierarchy and are viewing by week or year, while also respecting any filters selected within the slicers.

 

Example data is below (I have a slightly expanded example PBIX file but not sure how to share/if sharing is possible here):

 

ItemsByTransactionID

Transaction IDQuantityItemTransaction date
14Apples01/01/2001
19Oranges01/01/2001
19Pears01/01/2001
27Oranges09/01/2001
25Pears09/01/2001
27Apples09/01/2001
35Pears09/01/2001
39Oranges09/01/2001
37Apples09/01/2001

 

Transactions

Transaction IDRegionShopSeller
1NorthDurhamA
2NorthCarlisleB
3SouthBrightonC

 

Calendar

DateYearWeek
01/01/20012000/200140
02/01/20012000/200140
03/01/20012000/200140
04/01/20012000/200140
05/01/20012000/200140
06/01/20012000/200140
07/01/20012000/200140
08/01/20012000/200141
09/01/20012000/200141

 

Items

TypeItem
FruitApples
FruitPears
CitrusOranges

 

How do I go about doing this? I've tried to be clear while remaining concise, if anything doesn't make sense or any more info is needed to help then please let me know.

 

Thanks very much for any help!

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

If you already have your Total Sales measure then you can calculate the maximum daily amount with

Daily max sales =
MAXX ( VALUES ( 'Date'[Date] ), [Total Sales] )

Should work at any level of the date hierarchy.

For future reference, when people want to share PBIX files they tend to use a file sharing site like Dropbox or We Transfer, or else share directly from something like Google Drive or OneDrive.

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

If you already have your Total Sales measure then you can calculate the maximum daily amount with

Daily max sales =
MAXX ( VALUES ( 'Date'[Date] ), [Total Sales] )

Should work at any level of the date hierarchy.

For future reference, when people want to share PBIX files they tend to use a file sharing site like Dropbox or We Transfer, or else share directly from something like Google Drive or OneDrive.

Legend, thank you! I've spent days Googling around for solutions and trying needlessly complex things, I knew it would be something much more simple.

onurbmiguel_
Super User
Super User

hello paddysellsfruit

 

Can you share what will be the pretended result?

You can share by onedrive link or google drive link.

 

BR 

Bruno 

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


HoangHugo
Solution Specialist
Solution Specialist

Which charts be use for your daily maximum sales?  and daily maximum sales mean, which days have highest sales? or Which items have highest sales in one day?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.