Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have got a measure called [Result], the table this measure is based on is connected with a Date table with a Date column, [Date].[Date]. Given that today is 21st of june 2022, I would like to calculate the following:
Year | 01-01 until 06-21 | Entire Year | % |
2017 | x | x | 0.42 |
2018 | x | x | 0.54 |
2019 | x | x | 0.50 |
2020 | x | x | 0.46 |
2021 | 240 | 500 | 0.48 |
Average % | 0.48 |
I have no idea how to get started. This is way above my DAX knowledge. Can you please help me with this case?
Please let me know if I need to provide any other data or to clarify anything.
Solved! Go to Solution.
Hi @MHoogeveen ,
Please create these four measures.
TD =
VAR _year = YEAR(MAX('Date'[Date]))
VAR _month = MONTH(TODAY())
VAR _day = DAY(TODAY())
VAR _result =
CALCULATE(
[Result],
FILTER(
ALL('Date'),
'Date'[Date] >= DATE(_year,1,1)
&& 'Date'[Date] <= DATE(_year,_month,_day)
&& _year <> YEAR(TODAY())
)
)
RETURN
_result
% =
AVERAGEX(SUMMARIZE('Date','Date'[Year],"M1",[YTD],"M2",[Result]),DIVIDE([M1],[M2]))
YTD =
CALCULATE(
[Result],
DATESYTD('Date'[Date])
)
Expected values =
DIVIDE([YTD],[%])
Attached PBIX file for your reference.
Best Regards,
Gao
Community Support Team
If 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
Hi @MHoogeveen ,
Please create these four measures.
TD =
VAR _year = YEAR(MAX('Date'[Date]))
VAR _month = MONTH(TODAY())
VAR _day = DAY(TODAY())
VAR _result =
CALCULATE(
[Result],
FILTER(
ALL('Date'),
'Date'[Date] >= DATE(_year,1,1)
&& 'Date'[Date] <= DATE(_year,_month,_day)
&& _year <> YEAR(TODAY())
)
)
RETURN
_result
% =
AVERAGEX(SUMMARIZE('Date','Date'[Year],"M1",[YTD],"M2",[Result]),DIVIDE([M1],[M2]))
YTD =
CALCULATE(
[Result],
DATESYTD('Date'[Date])
)
Expected values =
DIVIDE([YTD],[%])
Attached PBIX file for your reference.
Best Regards,
Gao
Community Support Team
If 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
Thank you very much @Anonymous , took me a little while to check against my own results but your solution fits perfectly!
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 |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |