cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

need a measure

Hi,

 

I needed two measures to know current year ranking and previous year ranking from the data below:

 

Country NameRankingYear
India122019
India102020
US22020
US12019

 

Please help me to achieve this.

 

Thanks

1 ACCEPTED SOLUTION
vanessafvg
Super User
Super User

CurrentYearRank = CALCULATE(sum(Countries[Ranking]), FILTER(Countries, Countries[Year] = year(today())))
PreviousYearRank = CALCULATE(sum(Countries[Ranking]), FILTER(Countries, Countries[Year] = year(today())-1))
 
This should work.




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
vanessafvg
Super User
Super User

CurrentYearRank = CALCULATE(sum(Countries[Ranking]), FILTER(Countries, Countries[Year] = year(today())))
PreviousYearRank = CALCULATE(sum(Countries[Ranking]), FILTER(Countries, Countries[Year] = year(today())-1))
 
This should work.




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




az38
Community Champion
Community Champion

Hi @Anonymous 

try

CurrentYear = CALCULATE(MAX(Table[Ranking]), Table[Year] = YEAR(TODAY()) )

and

PrevYear = CALCULATE(MAX(Table[Ranking]), Table[Year] = YEAR(TODAY())-1 )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors