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.
Hi,
My company uses accounting periods that end on the last Friday of the month. This means that the start of the financial year is variable. Eg. This financial year (2022) began on the 26/6/2021 and financial year (2023) will begin on the 25/6/2021.
When writing YTD calculations, I have to input a string to define the end of the financial year eg
Solved! Go to Solution.
@Mo-PHAT , You need two things for YTD
Year and Day of year.
I am assuming you have logic for you start date, based on that You can create year. Numeric year.
Else create a rank on Start date of year
Year Rank = Rankx('Date', 'Date'[Start of Year],,asc,dense)
Day of year = Datediff([Start of year], [Date], day())
YTD= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank]) && 'Date'[Day of Year] <= Max('Date'[Day of Year]) ))
LYTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1 && 'Date'[Day of Year] <= Max('Date'[Day of Year])))
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
@Mo-PHAT , You need two things for YTD
Year and Day of year.
I am assuming you have logic for you start date, based on that You can create year. Numeric year.
Else create a rank on Start date of year
Year Rank = Rankx('Date', 'Date'[Start of Year],,asc,dense)
Day of year = Datediff([Start of year], [Date], day())
YTD= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank]) && 'Date'[Day of Year] <= Max('Date'[Day of Year]) ))
LYTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1 && 'Date'[Day of Year] <= Max('Date'[Day of Year])))
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
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 |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |