Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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
)
User | Count |
---|---|
13 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
28 | |
19 | |
13 | |
11 | |
7 |