Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello!
I have a measure that calculates sales per business day for each month. It just divides the total sales for the month by the number of business days in the month. Here is the DAX for that measure:
Sales/Bus Day =
DIVIDE([Sales, All Channels], CALCULATE(
SUM('Date Table'[Workday Flag]),
'Date Table'[Workday Flag] IN { 1 }
))
The expression,
CALCULATE(
ensures that I'm measuring sales per business day and not simply sales per day.
This works great if the month is already finished, but for the current month, it shows a very low figure, because not all the sales for the month have happened yet. How can I make a single measure that works both for months that have finished and for the current month?
Solved! Go to Solution.
@pwe5000 , Try a measure like
Sales/Bus Day =
DIVIDE([Sales, All Channels], CALCULATE(
SUM('Date Table'[Workday Flag]),
filter('Date Table','Date Table'[Workday Flag] IN { 1 } && 'Date Table'[Date] < today())
))
or
calculate(averageX(values('Date Table'[Date]),[Sales, All Channels]) ,'Date Table'[Workday Flag] IN { 1 } )
@pwe5000 , Try a measure like
Sales/Bus Day =
DIVIDE([Sales, All Channels], CALCULATE(
SUM('Date Table'[Workday Flag]),
filter('Date Table','Date Table'[Workday Flag] IN { 1 } && 'Date Table'[Date] < today())
))
or
calculate(averageX(values('Date Table'[Date]),[Sales, All Channels]) ,'Date Table'[Workday Flag] IN { 1 } )
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |