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

Join 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.

Reply
Anonymous
Not applicable

Index relative to minimum selected year

Hi everyone, 

 

 

I'm making a chart where the vertical axis is index and horizontal axis is year. 
The value for each year is the indexed change from the first year in the chart. 

For example, if the selected years are 2000-2015, then 2014 = (sum of 2014 values / sum of 2000 values) *100.

 

So far I've been trying different versions of the measure below, but I can't get it to work. 

It seems to keep the filter for min(year) and thus returns 100 for all years. 

 

Measure=
divide(sum('Data'[value]),calculate(sum('Data'[value]),
filter('Data','Data'[Year]=calculate(min('Data'[Year]),allselected('TV Data')))))*100

Can this be done?

 

1 ACCEPTED SOLUTION

Hi Danielgadhas ,

 

The result of a measure is based on current filtered context, so I'm afraid using a measure can't achieve your requirement, you should use calculate column instead.

 

Column = calculate(sum(Data[Value]), FILTER(all(Data), Data[Year]=min(Data[Year])))

Regards,

Jimmy Tao

View solution in original post

8 REPLIES 8
AutyDA
Helper I
Helper I

I'm trying to do the same type of chart and struggling, did you ever find a solution? If so please share the file.

 

Thanks.

Anonymous
Not applicable

Hi again, 

 

I may have narrowed down the problem, but I still don't have a solution. 

 

calculate(min('Data'[Year]),allselected('TV Data'))

This shows the right year. Meaning if 2000 is the lowest selected year it shows in all years. 

 

However, it doesn't work as a filter in this expression:

calculate(sum('Data'[value]),
filter('Data','Data'[Year]=calculate(min('Data'[Year]),allselected('TV Data')))

I want it to return the sum of the values from the lowest selected year, but it simply shows the sums of each year. 

The return is the same as sum('Data'[Value]), which explains why the full expressions returns 100. 

 

Anyone knows why this filter is not applying? I'm sure there is a logical answer 🙂

 

 

@Anonymous

 

Try removing the inner calculate

 

CALCULATE (
    SUM ( 'Data'[value] ),
    FILTER ( 'Data', 'Data'[Year] = MIN ( 'Data'[Year] ) ),
    ALLSELECTED ( 'TV Data' )
)

 

Anonymous
Not applicable

@Zubair_Muhammad

 

Thank you for responding. 

 

I tried your solution but unfortuently it still returns the sum of each individual year instead of the first. 

 

I've made a small mockup using this data:
Table.PNG

 

 

 

 

 

 

 

Here is the return:

measure = calculate(sum(Data[Value]);FILTER(Data;Data[Year]=min(Data[Year]));allselected(Data))
Return.PNG

 

 

 

 

 

 

 

In this case I want the measure to show 110 for all the rows whereas the value shows the sum of the specific year. 

The goal is to divide value by measure to show the difference from the lowest selected year. 

 

 

 

 

Hi Danielgadhas,

 

I have test on your data but can't reproduce your issue as below, could you share your PBIX if possible?

捕获.PNG 

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi @v-yuta-msft

 

You are reproducing my problem. In your table I'd like the measure to show the value from 110 while keeping other filters applied. 

 

I've made some progress and I have a working expression with a static baseline year. Now I only have to make it dynamic, which is arguably the hardest part. 

 

Index (2014):=
  divide(
    sum('Data'[value]),
    calculate(sum('Data'[value]),
      filter(
        ALLEXCEPT('Data','Data'[Slicer1],'Data'[Slicer2]),
          'Data'[Year]=2014
)
)
) *100

Apologies if I'm being unclear, but in Index (2014) I'd like to replace 2014 with the lowest selected year in the year slicer. 

Hi Danielgadhas ,

 

The result of a measure is based on current filtered context, so I'm afraid using a measure can't achieve your requirement, you should use calculate column instead.

 

Column = calculate(sum(Data[Value]), FILTER(all(Data), Data[Year]=min(Data[Year])))

Regards,

Jimmy Tao

Anonymous
Not applicable

@v-yuta-msft

Ok, I will consider using a calculated column and alternatively make more than one measure. 

 

Thanks for your help 🙂 

 

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.