Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Dear All, I'm looking for a dax formula to create a calculate index for each year as per table below:
basically it would take the first item (A) and divide by the value *100 per year.
Year | Item | Values | Index Year Calculated example expected |
2019 | A | 2450 | 100 |
2019 | B | 3000 | 122 |
2019 | C | 1900 | 78 |
2020 | A | 6000 | 100 |
2020 | B | 5500 | 92 |
2020 | C | 9000 | 150 |
Solved! Go to Solution.
Hi @leandroduarte ,
You may create measure like DAX below.
Index Year =
VAR ValueA =
CALCULATE (
MAX ( Table1[Values] ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[Year] = MAX ( Table1[Year] )
&& Table1[Item] = "A"
)
)
VAR Current =
MAX ( Table1[Values] )
RETURN
DIVIDE ( ValueA * 100, Current )
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @leandroduarte ,
You may create measure like DAX below.
Index Year =
VAR ValueA =
CALCULATE (
MAX ( Table1[Values] ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[Year] = MAX ( Table1[Year] )
&& Table1[Item] = "A"
)
)
VAR Current =
MAX ( Table1[Values] )
RETURN
DIVIDE ( ValueA * 100, Current )
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@leandroduarte , expected output is not clear
is it
divide([Value],[index Year])*100
or
divide(Sumx(filter(Table, [Year] =earlier([Year]) && [Item] ="A"),[Values]),umx(filter(Table, [Year] =earlier([Year]) && [Item] ="A"),[ Index Year]))*100
it basically need always to compare to the Values depending on year and fixing on the Iteam A
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
121 | |
87 | |
77 | |
61 | |
58 |
User | Count |
---|---|
129 | |
114 | |
96 | |
71 | |
71 |