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 guys,
I am trying to create my own forecast because it is based on a planning.
To do this I have a few measures and some data to go with it.
Measure to determine the price of the hours in a certain month:
Planning = sumx('Forecast'; 'Forecast'[Hours] * 'Forecast'[PriceFC])
Measure to calculate the cumulative total of the worked hours
CumulativeTotal = CALCULATE(Sum(TimeTransactions[AmountFC]);FILTER(ALL(PowerBI_Calendar[Date]); PowerBI_Calendar[Date] <= Max(PowerBI_Calendar[Date])))
Measure to determine if I need to use the actual worked hours or the planning:
GuideLine = IF(OR(SUMX(TimeTransactions; TimeTransactions[AmountFC]) = BLANK(); SUMX(TimeTransactions; TimeTransactions[AmountFC]) < [Planning]); [Planning]; SUM(TimeTransactions[AmountFC]))
Measure to get the cumulative total of my guideline so it can be shown nicely in a graph:
Cumulative Forecast = CALCULATE([GuideLine];FILTER(ALL(PowerBI_Calendar[Datum]); PowerBI_Calendar[Datum] <= Max(PowerBI_Calendar[Datum])))
The problem lies with the Cumulative forcast, it should be a different number than it is showing.
Does anyone know what I am doing wrong?
Hi @Anonymous
So what's in table 'TimeTransactions'?Can you show me your .pbix file?
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Hi @Greg_Deckler ,
I have been trying your solution, but I am not sure how to continue.
I made this measure:
Try this:
MyMeasure2 =
VAR __table = SUMMARIZE(TimeTransactions;[Maand];"__value"; [GuideLine])
Return
IF(HASONEVALUE(TimeTransactions[Project]); [GuideLine];SUMX(__table; [__value]))
You should summarize by whatever you are summarizing by in your table visualization (it looks like "Maand"). The value (__value) should be the measure you want to aggregate correctly in the total line.
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |