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.
Hi Power Bi Community,
I need your support on writting DAX commend.
I've a table that consist of project ID and Turnover over the years.
Project ID | Turnover MEUR | Year |
ID99 | 0,1 | 2021 |
ID98 | 0,5 | 2021 |
ID99 | 0,3 | 2022 |
ID98 | 0,7 | 2022 |
ID99 | 0,5 | 2023 |
ID98 | 0,9 | 2023 |
I'd like to subtract turnover over years, in order to be able calculate the growh. In other words,
Growth = Turnover 2022 (ID99) - Turnover 2021 (ID99), Turnover 2023 (ID99) - Turnover 2022 (ID99), Turnover 2022 (ID98) - Turnover 2021 (ID98) ...etc.
Any ideas, how I can write this in DAX command ?
Solved! Go to Solution.
Hi @Anonymous
Please refer to the sample with the solution https://www.dropbox.com/t/80L2KufXOL8k8xLc
Turnover YOY =
VAR CurrentYer = SELECTEDVALUE ( Turnover[Year] )
VAR FirstSelectedYear = CALCULATE ( MIN ( Turnover[Year] ), ALLSELECTED ( Turnover ) )
VAR CurrentValue = SUM ( Turnover[Turnover MEUR] )
VAR PreviousValue = CALCULATE ( SUM ( Turnover[Turnover MEUR] ), Turnover[Year] = CurrentYer - 1 )
RETURN
IF (
CurrentYer <> FirstSelectedYear,
CurrentValue - PreviousValue
)
Hi @Anonymous
Please refer to the sample with the solution https://www.dropbox.com/t/80L2KufXOL8k8xLc
Turnover YOY =
VAR CurrentYer = SELECTEDVALUE ( Turnover[Year] )
VAR FirstSelectedYear = CALCULATE ( MIN ( Turnover[Year] ), ALLSELECTED ( Turnover ) )
VAR CurrentValue = SUM ( Turnover[Turnover MEUR] )
VAR PreviousValue = CALCULATE ( SUM ( Turnover[Turnover MEUR] ), Turnover[Year] = CurrentYer - 1 )
RETURN
IF (
CurrentYer <> FirstSelectedYear,
CurrentValue - PreviousValue
)
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 |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |