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.
Hello,
have a formula = (actual month sales/act month working days) * working days in month.
Model contain Calendar table with key whitch indicate is it a working days or not [WordkingDayYN]
And Fact Sales tables by dates
I need to create a Chart with Sales on Y and MonthNames on X for selected year.
Solved! Go to Solution.
Hi @mrslyfox,
Please try:
MTD Sales = CALCULATE ( SUM ( Sales[Sales] ), FILTER ( 'Calendar', 'Calendar'[LINK_Date].[Day] <= DAY ( TODAY () ) ) ) MTD working days = CALCULATE ( SUM ( 'Calendar'[WorkingDay] ), FILTER ( 'Calendar', 'Calendar'[LINK_Date].[Day] <= DAY ( TODAY () ) ) ) Working days total per month = CALCULATE ( SUM ( 'Calendar'[WorkingDay] ), ALLEXCEPT ( 'Calendar', 'Calendar'[LINK_Date].[Month] ) ) Act Sales = [MTD Sales]/[MTD working days]*[Working days total per month]
Best regards,
Yuliana Gu
Hi @mrslyfox,
Not very clear about the difference between the two highlighted parts.
Based on my assumption, the former one means the actual working days per month depend on the values of [WorkingDayYN], the latter one means the number of dates each month.
If that is the case, please try below measures:
Month Total Sales = CALCULATE ( SUM ( Sales[Sales] ), ALLEXCEPT ( 'Calendar', 'Calendar'[LINK_Date].[Month] ) ) Woring day per month = CALCULATE ( COUNTROWS ( 'Calendar' ), ALLEXCEPT ( 'Calendar', 'Calendar'[LINK_Date].[Month] ) ) Actual Woring days = CALCULATE ( SUM ( 'Calendar'[WorkingDay] ), ALLEXCEPT ( 'Calendar', 'Calendar'[LINK_Date].[Month] ) ) Act Sales = [Month Total Sales]/[Actual Woring days]*[Woring day per month]
Please refer to the uploaded .pbix file for details.
Best regards,
Yuliana Gu
Example:
Today: 26 - October
Act Sales = MTD Sales for October = 22 645 684.89
October Calendar days: 31
working days in month = October Total Working days Total = 22
act month working days = October MTD Working days = 19
resuted formula: = 22 645 684.89 / 19 * 22 = 26 221 319.34
up
Hi @mrslyfox,
Please try:
MTD Sales = CALCULATE ( SUM ( Sales[Sales] ), FILTER ( 'Calendar', 'Calendar'[LINK_Date].[Day] <= DAY ( TODAY () ) ) ) MTD working days = CALCULATE ( SUM ( 'Calendar'[WorkingDay] ), FILTER ( 'Calendar', 'Calendar'[LINK_Date].[Day] <= DAY ( TODAY () ) ) ) Working days total per month = CALCULATE ( SUM ( 'Calendar'[WorkingDay] ), ALLEXCEPT ( 'Calendar', 'Calendar'[LINK_Date].[Month] ) ) Act Sales = [MTD Sales]/[MTD working days]*[Working days total per month]
Best regards,
Yuliana Gu
up
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |