Forum Discussion

paddysellsfruit's avatar
paddysellsfruit
Frequent Visitor
4 years ago
Solved

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!

 

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

4 Replies

  • onurbmiguel_'s avatar
    onurbmiguel_
    Icon for Power Participant rankPower Participant

    hello paddysellsfruit

     

    Can you share what will be the pretended result?

    You can share by onedrive link or google drive link.

     

    BR 

    Bruno 

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

    • paddysellsfruit's avatar
      paddysellsfruit
      Frequent Visitor

      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.

  • HoangHugo's avatar
    HoangHugo
    Icon for Solution Specialist rankSolution 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?