The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a date table.
We have our orders that come in daily, although some days no orders come in. I need to determine the average number of orders per month. Using order ID.
so a simple example below. If the first 4 days of a month had these counts of distinct orders, determine the average number of orders that month. So the measure should count days with no orders. In this example the month average would be 4.25.
5
0
8
4
Solved! Go to Solution.
Hi , @Anonymous
If no orders come in on a certain day of a month and that day will still be counted,you can try measure as below:
Measure2 =
var countRow=CALCULATE(COUNT('Table'[Day of month]),ALL('Table'))
var days=DAY(EOMONTH(SELECTEDVALUE('Table'[Date]),0))
return DIVIDE(countRow,days)
Best Regards,
Community Support Team _ Eason
Hi , @Anonymous
If no orders come in on a certain day of a month and that day will still be counted,you can try measure as below:
Measure2 =
var countRow=CALCULATE(COUNT('Table'[Day of month]),ALL('Table'))
var days=DAY(EOMONTH(SELECTEDVALUE('Table'[Date]),0))
return DIVIDE(countRow,days)
Best Regards,
Community Support Team _ Eason
@Anonymous
Simple Average will do as, by default, Average function will not consider blank, but if you want to avoid zero then
Use
Measure = CALCULATE(
AVERAGE('Table'[Column1]),
'Table'[Column1]>0)
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @Fowmy I am counting text strings, not values. So this does not seem to work.
For example: First 4 days of the month. 4 distinct orders (two on the 1st day of the month). So, 5 orders in 4 days. Average orders per day. 1.25
Day of Month Order ID
1 1234
1 1237
2 3490
3 3456
4 3457
@Anonymous
Try this Measure:
Measure =
DIVIDE(
COUNT(ORDER_TABLE[ORDER ID]),
DISTINCTCOUNT(ORDER_TABLE[DATE]))
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
83 | |
64 | |
58 |
User | Count |
---|---|
248 | |
123 | |
112 | |
79 | |
78 |