Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I would like to determine the average sales per month, based on calendar days in the month. The logic is straightforward, total number of sales in a month, divide by number of days. As seen in my example below for February it should 1400/28 = 50 (Light blue column in screenshot below)
Once I have the average, I want to plot that per month on a timeline. I also need the current month to divide by only the amount of days that has expired. Thus if it's 15th of April, divide by 15 and not 30.
I have date dimention table and a table with the days per month that I have linked to the date dim on monthname. However when I create a measure I don't know how to join on the month and divide by the correct number of days.
Thanks!
Solved! Go to Solution.
Hi @DieLem
Create measures
Measure =
CALCULATE (
COUNT ( 'calendar'[Date] ),
FILTER (
ALL ( 'calendar' ),
'calendar'[year] = MAX ( 'calendar'[year] )
&& 'calendar'[month] = MAX ( 'calendar'[month] )
&& 'calendar'[Date] <= TODAY ()
)
)
Measure 2 = SUM('Table'[sales])/[Measure]
Hi @DieLem
Create measures
Measure =
CALCULATE (
COUNT ( 'calendar'[Date] ),
FILTER (
ALL ( 'calendar' ),
'calendar'[year] = MAX ( 'calendar'[year] )
&& 'calendar'[month] = MAX ( 'calendar'[month] )
&& 'calendar'[Date] <= TODAY ()
)
)
Measure 2 = SUM('Table'[sales])/[Measure]
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |