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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
henry24007
Helper I
Helper I

measure does not work

henry24007_1-1658203408916.png

 

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_2-1658203638341.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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