Hi,
I have calculated average sales in the last 3 months.
Month Avg Sales Qty
July 300 250
Aug 300 600
Sep 300 400
Solved! Go to Solution.
Hi @Sdhn420 ,
According to my understanding, the reason why the test formula you used is reporting an error is because format("30.06", "dd.mm.yyyy") returns a text type, not a date type, so an error will be reported. Try the following formula:
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
you did not replace the complete text I asked for.
Please replace the whole text FORMAT("30.06.2020","dd.mm.yyyy")
by
"30.06"
so that you have:
VAR
DURATION = DATESYTD('d_Calender'[Date],"30.06.")
RETURN
CALCULATE(AVERAGE([SalesQty]),DURATION)
Best regards
Mikelytics
Did I solve your request? Please mark my post as solution.
Appreciate your Kudos.
Hi @Sdhn420 ,
According to my understanding, the reason why the test formula you used is reporting an error is because format("30.06", "dd.mm.yyyy") returns a text type, not a date type, so an error will be reported. Try the following formula:
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Sdhn420 ,
Can you please try the following:
VAR
DURATION = DATESYTD('d_Calender'[Date],FORMAT("30.06.2020","dd.mm.yyyy"))
RETURN
CALCULATE(AVERAGE([SalesQty]),DURATION)
Best regards
Mikelytics
Did I solve your request? Please mark my post as solution.
Appreciate your Kudos.
HI @Sdhn420
sorry, my mistake.
Please replace FORMAT("30.06.2020","dd.mm.yyyy") by "30.06"
Best regards
Mikelytics
Did I solve your request? Please mark my post as solution.
Appreciate your Kudos.
@Sdhn420 can you post sample data and expected output, when you said "constant", what value you like to see as constant. Provide a bit more context/business rules.
Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Check out new user group experience and if you are a leader please create your group
100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.
User | Count |
---|---|
414 | |
162 | |
106 | |
82 | |
58 |
User | Count |
---|---|
426 | |
176 | |
133 | |
108 | |
85 |