Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get 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

Reply
leandroduarte
Helper I
Helper I

Create a Calculate index per year

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.

 

YearItemValuesIndex Year Calculated example expected
2019A2450100
2019B3000122
2019C190078
2020A6000100
2020B550092
2020C9000150
1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

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.

View solution in original post

3 REPLIES 3
v-xicai
Community Support
Community Support

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.

amitchandak
Super User
Super User

@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

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

it basically need always to compare to the Values depending on year and fixing on the Iteam A

Helpful resources

Announcements
Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.