Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have two curves representing the hours planned and completed for each month.
I'd like to sum up the hours planned for each year, then calculate this sum and subtract the hours actually worked, to see how the hours consumed have evolved. The difficulty I'm having is that I'm having problems with my data modeling (maybe I need to modify something with my data architecture because I have Sum of Initial No. Hours 2023 and 2024 that I've calculated (I'm also interested in sources on how to properly model data for Power BI). I was able to remedy this by calculating the planned hours for the period :
Heures prévues période =
VAR DateMin = MIN('Heures réalisées'[Date]) // Recovers the minimum date after filtering
VAR DateMax = MAX('Heures réalisées'[Date]) // Retrieves the maximum date after filtering
VAR NbMois = DATEDIFF(DateMin, DateMax, MONTH) + 1 // Calculates the number of evolved months
RETURN
[Heures Prévues] * NbMois // Multiplies the scheduled hours by the number of months elapsed
I've tried some complex calculations but without success, and I think there's a simpler way of doing this. In addition, I'm interested in the possibility of forcasting the hours achieved by displaying them with dashes, for example forcasting.
Thank you for your help (and sorry for the content in french)
//Try this
Difference (Planned - Actual) =
VAR SumPlannedHours = SUM('Heures prévues'[Heures Prévues])
VAR SumCompletedHours = SUM('Heures réalisées'[Heures Réalisées])
VAR PlannedHoursPerYear = CALCULATE(SumPlannedHours, ALLEXCEPT('Date Table', 'Date Table'[Year]))
VAR CompletedHoursPerYear = CALCULATE(SumCompletedHours, ALLEXCEPT('Date Table', 'Date Table'[Year]))
RETURN
PlannedHoursPerYear - CompletedHoursPerYear
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Hello @mh2587,
Thank you very much for the reply. I wanted to do sth like this exactly, I still have the problem that "heures prévues" is measure style and so I can't sum?
If ever here is my structure and my measure "heures prévues".
Heures prévues =
VAR YearOfDate = YEAR(MAX('Heures réalisées'[Date])) // ou MIN, selon la granularité de vos données
RETURN
DIVIDE(
SWITCH(
YearOfDate,
2023, SUM('Heures prévues'[Nbre Heures initial 2023]),
2024, SUM('Heures prévues'[Nbre Heures initial 2024]),
BLANK()
),
12
)
Thanks
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |