Forum Discussion
driplytics
4 years agoFrequent Visitor
Select a Table value based on a DAX function
Hey, i have GDP data with colunms : Country, GDP, Year. i used a Dax functions to calculate GDP Growth %, and ranked it In the Growth Rank Column. Here's what i want to do : I want to show the...
- 4 years ago
Hi,
I am not sure how your data model looks like, but please try to put the below measure into a card visualization.
expected measure for card visual: = SUMMARIZE ( FILTER ( ADDCOLUMNS ( ALL ( 'Countries GDP 1960-2020'[Year] ), "@ranking", [Growth Rank] ), [@ranking] = 1 ), 'Countries GDP 1960-2020'[Year] )
vapid128
4 years agoSolution Specialist
add colnum
LastYearGDP = lookupvalue('Countries GDP 1960-2020'[GDP], 'Countries GDP 1960-2020'[Year], 'Countries GDP 1960-2020'[Year] - 1, 'Countries GDP 1960-2020'[Country], 'Countries GDP 1960-2020'[Country])
add measure
BestGDP = maxx(values( 'Countries GDP 1960-2020'[Year]), calculate(DIVIDE(sum('Countries GDP 1960-2020'[GDP])-sum('Countries GDP 1960-2020'[LastYearGDP]),sum('Countries GDP 1960-2020'[LastYearGDP]))