Forum Discussion
Create Dax measure to find missing days & fetch the value for those days that falls between 2 dates
Hi SergeiBaklan ,
Thanks for your quick response Sir!
Yes Sir! It was the second question of my previous post.
It required brief information to be provided so thought I would raise the second question in a separate post.
Also, thought one question in a post will avoid confusion sir
PFA sample excel file here Carbon.xlsx
PFA power bi file here Portfolio 6 latest (2) - Copy (1).pbix
Thanks in advance!
Hi SergeiBaklan
Just to confirm, have you made any progress on this?
If not nop! we have made some progress sir!
The measure as below:
Pre_forecast_TCarbon =
VAR _Totalunits =
CALCULATE ( SUM ( Target[Value] ), FILTER ( Target, Target[TargetType] = 0 ) )
VAR _noofdays = [no of days]
VAR _DailyUnits =
DIVIDE ( _Totalunits, _noofdays )
VAR _Factor =
CALCULATE (
AVERAGE ( Factor[Value] ),
FILTER (
Factor,
Factor[StartDate] <= MAX ( Calendar_[Date] )
&& Factor[EndDate] >= MAX ( Calendar_[Date] )
&& Factor[DBName - Utility] IN VALUES ( Points[DBName-Utility] )
)
)
RETURN
CALCULATE (
SUMX ( 'Calendar_', _DailyUnits * _Factor ),
FILTER ( Calendar_, ISBLANK ( [Actual Units] ) )
)
When we drag this measure into visual, we found the below issue:
The total was showing 698.43 instead of 458.17.
We have broken down the above measure(highlighted in yellow) into two different measures(orange color) for our reference purpose as shown below:
Multiplication of these two orange color measures should give the highlighted value in yellow.
The expected output should be total row showing 458.17 for that measure similar to row level.
Could you please help us resolve this issue?
Thanks sir!