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.
Hi all,
I've been having trouble with a measure I created that is supposed to dynamically calculate hours vs hours available over a moveable time period. This time period is based on a minimum date in the same table the hours lie in. The end date is then set to that minimum date plus the value of a parameter, allowing the user to select how far forward they want to look.
Please see my measures below:
Latest Load Date = FIRSTDATE(FIN_Hours_Lookahead[Date]) -1
Next Week Start = [Latest Load Date] + (IF( WEEKDAY([Latest Load Date],2) <= 4, (- WEEKDAY([Latest Load Date],2) + 5), (- WEEKDAY([Latest Load Date],2) + 12) ) )
AvailHrsSlider = CALCULATE( SUM(FIN_Hours_Lookahead[hoursAvailable]), FILTER(FIN_Hours_Lookahead, FIN_Hours_Lookahead[Date] >= [Next Week Start] && FIN_Hours_Lookahead[Date] <= [AvailBookedHrsEndDate] ) )
BookedHrsSlider = CALCULATE( SUM(FIN_Hours_Lookahead[hoursBooked]), FILTER(FIN_Hours_Lookahead, FIN_Hours_Lookahead[Date] >= [Next Week Start] && FIN_Hours_Lookahead[Date] <= [AvailBookedHrsEndDate] ) )
DiffHrs = [AvailHrsSlider]-[BookedHrsSlider]
AvailBookedHrsEndDate = [Next Week Start] + (WeeksAhead[WeeksAhead Value]*7)
And finally my parameter:
WeeksAhead = GENERATESERIES(0, 13, 1) WeeksAhead Value = SELECTEDVALUE('WeeksAhead'[WeeksAhead])
The final output should look something like below, however, whilst the hours booked/available are working correctly, the parameter input doesn't limit the bars on the chart. If I select 1 in the Weeks Ahead paramter, I should only see 1 bar. If I select 5, I should only see 5.
Would anyone have any idea why this isn't working?
Strangely when I change the [Next Week Start] measure to [Report Date] (which is just the TODAY() formula), the parameter input works correctly.
Any help would be much appreciate as always!
I know I can count on you guys @Mariusz @MattAllington @v-diye-msft
Cheers,
Aaron
Hi @Anonymous
Do you want to show values of weeknum from "Next Week Start" to "AvailBookedHrsEndDate"?
Best Regards
Maggie
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 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |