Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Objective:
Here we have a target table provided at the Month level and we would like to display the target at the day level also we would like to see MTD Targets.
Data:
The target table has 4 columns: Target and Month. Quarter and Year
Solution:
We have added 2 new columns to the target table Month start date and the Month end date (Named it Date).
Month Date = "01-" &[Order_Month] & "-" &[Years] // Month Start Date. Changed Data Type to Date
Date = EOMONTH([Month Date],0) // Month End Date
We also added a date table. this table has 2 columns date and year.
Date = ADDCOLUMNS(CALENDAR(date(2013,01,01),date(2020,12,31)),"Year", year([Date]),"Year Month",FORMAT([Date],"YYYYMM"))
Daily Target: To create a daily target we used the closing balance of the Month. This will replicate the data for each day of the Month. You will be able to see the same number every day. Visual is using date from date table.
Now we need to divide each of these rows by days of Month to get the correct daily target
Measure
Daily Target = CLOSINGBALANCEMONTH(sum(Target[Month Target])/(maxx(Target,DATEDIFF(Target[Month Date],Target[Date],day))+1),'Date'[Date])
MTD Target = CLOSINGBALANCEMONTH(sum(Target[Month Target])/(maxx(Target,DATEDIFF(Target[Month Date],Target[Date],day))+1),'Date'[Date]) *TOTALMTD(COUNT('Date'[Date]),'Date'[Date])
Let us know what you think about this.
The file can found at https://community.powerbi.com/t5/Quick-Measures-Gallery/Distributing-Allocating-the-Monthly-Target-C...
You can get all my posts at https://community.powerbi.com/t5/Data-Stories-Gallery/Blog-Analysis/m-p/1265567#M4403
You can also follow my YouTube channel (YouTube) and LinkedIn (profile) to get information on the upcoming webinars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.