Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have a "Sales Goal" table with "Sales Rep", "Attribute" (Month), and "Value"(Sales Goal Amount).
I have a measure to calculate the Sales Goal Amount by day for the selected month.
DailySalesGoalAMT = sum('Sales Goal'[Sales Goal Amount])/(DAY(EOMONTH('Date'MAX('Date'[Date]),0)))
I am currently trying to calculate the Actual Year-To-Date Sales Goal Amount.
For example: if I have selected 5/10/2021 I want to see the total Sales Goal Amount for 1/1/2021 - 5/10/2021.
I need to create a measure that will calculate the Sales Goal Amoutns for the days passed between the 1st day of the year and the current selected day. But keep in mind, each month has a different Sales Goal Amount.
Hi @DSwezey ,
You need create a table without relationships with these table above. Called Forslicer_table.
You can use some measures like following:
Total Sales =
CALCULATE(
SUM( 'Monthly Sales'[Value] ),
FILTER(
ALL( ForSlicer ),
[Date] >= DATE( 2021, 1, 1 )
&& [Date] <= SELECTEDVALUE( 'Forslicer_table'[date] )
)
)
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DSwezey
So if I'm understanding you right, the reason you can't do a straightfoward YTD calculation is because your sales goals are recorded in months rather than day by day?
When I've done something similar to this in the past, I have joined my goals table onto a calendar (using the month name or month start date for the join) which then expands each month into one row per day. Your calendar table would also need a column for the number of days in the month, so you can then divide your Value column by that, essentially creating a column which is the goal for that day (i.e. any day in October for Nick is 52234 / 31)
Once you have this Goals by Day table, which is one row per person, per day, you can then do a Year to Date calculation on the new column.
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
100 | |
66 | |
58 | |
47 | |
46 |