Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
hi All
I am looking to create a dynamic Week on Week Target which should be based on Actuals
so there is Target set for each week as you can see below, if lets say in the Week 2, we over achieve the Target which in the below case 6,483.88, this Variance should be equally needs to be passed on to the remaining weeks, this way every week, Target should dynamically change based on what actuals we have , if the Target is not met, then subsequent weeks target should increase and decrease vice versa
i tried creating something using Chat GPT but it doesn't give me the right output
Adjusted Target =
VAR CurrentWeek = MAX('YTD Timesheet'[Week])
VAR CurrentWeekTarget = [Tar WTD]
VAR PreviousWeekVariance = CALCULATE([Variance], FILTER(ALL('YTD Timesheet'), 'YTD Timesheet'[Week] = CurrentWeek - 1))
VAR RemainingTarget = CurrentWeekTarget -[YTD Charged Hours]
VAR RemainingWeeks = 52-MAX('Calendar'[#Week])
VAR ProratedVariance = IF(RemainingWeeks > 0, PreviousWeekVariance / RemainingWeeks, 0)
VAR IsTargetOverAchieved = IF([YTD Charged Hours] > CurrentWeekTarget, 1, 0)
VAR AdjustedTarget =
IF(
IsTargetOverAchieved,
IF(
RemainingWeeks > 0,
CurrentWeekTarget - ProratedVariance,
CurrentWeekTarget
),
IF(
RemainingWeeks > 0,
CurrentWeekTarget + ProratedVariance,
CurrentWeekTarget
)
)
RETURN
RemainingTarget
please help, i spent a full day in figuring out, how to arrive at Revised Target based on Actuals
Hi @vjnvinod ,
@Greg_Deckler Thanks for your concern about this case!
@vjnvinod As you said: "if the Target is not met, then subsequent weeks target should increase and decrease vice versa", so the plus and minus signs here in DAX should be reversed:
And here, what is the table Calendar?
Other than that, there's nothing else wrong with this DAX, and I've tested it, and here's what I got:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@vjnvinod Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
108 | |
101 | |
93 | |
69 |
User | Count |
---|---|
173 | |
135 | |
132 | |
101 | |
95 |