Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I am trying to calculate the 'Number of days' and 'Average number of sales per month' based on the between dates slicer.
The number of days is not changing to the desired 306 days from march 2021 till december 2021.
Dag=Day, Kalender=Calendar
The average is not working as well :'/, It should devide 13 with 10 months. But there were no sales in July, August and December, so the the dax devides the total sales with 7.
Maand=month
Do you guys have any idea how to fix this?
Solved! Go to Solution.
@CasperSV change your measure to
Number of Days = COUNTROWS ( Kalendar )
and remove .maand in your average measure.
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi, @CasperSV ;
Try it.
Average sales = DIVIDE([Number of Sales], COUNTROWS( SUMMARIZE('Kalendar',[Date].[Year],[Date].[Month])))
I tested it, and it should work. Looking forward to your reply
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @CasperSV ;
Try it.
Average sales = DIVIDE([Number of Sales], COUNTROWS( SUMMARIZE('Kalendar',[Date].[Year],[Date].[Month])))
I tested it, and it should work. Looking forward to your reply
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It worked!
Thanks a lot guys.
Hi guys,
no one any idea how to fix the average number of sales per month?
When I remove .maand (.month), the average is 1:
When adding .maand (.month), the average is 2 (which is correct):
However, as soon as there are no sales in July and August, the average stays 2 but it should change to 1,2.
Hope you guys know the solution.
@CasperSV change your measure to
Number of Days = COUNTROWS ( Kalendar )
and remove .maand in your average measure.
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi Parry2k,
Thanks! The Number of days is now working 😊
However, removing .maand did not work :'/.
It should be 1,083333 and dynamic based on the between calendar slicer.
Hi @CasperSV ,
When you are doing AVERAGEX, if your data is at the level of date, the AverageX is going to be done by number of days.
Instead you can try using DIVIDE function to get the sales by month. Something like the one below
Mymeasure = DIVIDE(SUM(table1[Sales]), DISTINCTCOUNT(table[Date].[Month]))
May be if you can share more info on how your data looks, ppl. in the community might be able to help you
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |