Forum Discussion
Fill down all matched value same year
- Anonymous2 years ago
Hi hoangDAO81 ,
Is it necessary to compare [ENERGY CONSUMPTION BY] under the same ID? If so, try this measure:Energy consumption BY = VAR _base_year = SELECTEDVALUE('Total E'[Baseyear]) VAR _result = CALCULATE([Energy comsumption], 'Total E'[Year]=_base_year) RETURN _resultBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
hoangDAO81 , First all all have separate Year/Date table and join back with date or year and then have measures like
//Only year vs Year, not a level below
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
Fixed Base year
Base Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=2018 ))
or
This Year =
Var _min = minx(allselected(Date), Date[Year])
return
CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=_min ))
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA