Forum Discussion

henry24007's avatar
henry24007
Icon for Helper I rankHelper I
4 years ago
Solved

measure does not work

 

I have two measures to calcuate the score last year and this year which shown in above image(last year1 and this year1) , but the last year measure goes wrong and I can't figure out why.

 

Here are two measures:

 

This Year1 = CALCULATE(SUM('Score (2)'[Score]),filter(ALL('year'),'year'[year]=max('year'[year])))
 
Last Year1 = CALCULATE(sum('Score (2)'[Score]),filter(ALL('year'),'year'[year]=max('year'[year])-1))
 
 
And in my power query table, I have added a index for every 23 rows in order which show in below and if I cencel this, the above measure will work, but I have to contain this every 23 rows order for other operations . is there any way I can make the measure work? Thanks

 

  • henry24007 , The measures seem fine. Make sure year table is joining with this table and 1 - Many single direction join from Year to this table.

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

2 Replies

  • henry24007 , The measures seem fine. Make sure year table is joining with this table and 1 - Many single direction join from Year to this table.

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

    • henry24007's avatar
      henry24007
      Icon for Helper I rankHelper I

      I solved it. it seems like my relationship line is so messy that it affected the measure. anyway thanks for your help again