Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have Country Name and Years columns i want to show the Growth for each country in last 5 years
Solved! Go to Solution.
Hi mohammedkhan,
According to your description, I create sample data to reproduce the scenario. You can implement your demand following steps below.
Firstly, convert the column 2012-2017 to row data like picture below. Named the new column "Year", and change its data type to Whole Number.
Then, create measure named Year Growth to get the Growth for each country in last 5 years.
Year Growth =
VAR _previous = CALCULATE(SUM(Table1[Value]),FILTER(ALLSELECTED(Table1), 'Table1'[Country Name]=MAX(Table1[Country Name])&&Table1[Year] = MAX(Table1[Year]) -1))
VAR _current = CALCULATE(SUM(Table1[Value]),FILTER(ALLSELECTED(Table1),'Table1'[Country Name]=MAX(Table1[Country Name])&&Table1[Year] =MAX(Table1[Year])))
return
IF(_previous<>BLANK(),DIVIDE(_current,_previous,0)-1,BLANK())
Choose the table visual to display the result.
Here is my test pbix file link: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EfAtmoNdJf9Cl34-EE...
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mohammedkhan,
According to your description, I create sample data to reproduce the scenario. You can implement your demand following steps below.
Firstly, convert the column 2012-2017 to row data like picture below. Named the new column "Year", and change its data type to Whole Number.
Then, create measure named Year Growth to get the Growth for each country in last 5 years.
Year Growth =
VAR _previous = CALCULATE(SUM(Table1[Value]),FILTER(ALLSELECTED(Table1), 'Table1'[Country Name]=MAX(Table1[Country Name])&&Table1[Year] = MAX(Table1[Year]) -1))
VAR _current = CALCULATE(SUM(Table1[Value]),FILTER(ALLSELECTED(Table1),'Table1'[Country Name]=MAX(Table1[Country Name])&&Table1[Year] =MAX(Table1[Year])))
return
IF(_previous<>BLANK(),DIVIDE(_current,_previous,0)-1,BLANK())
Choose the table visual to display the result.
Here is my test pbix file link: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EfAtmoNdJf9Cl34-EE...
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 33 | |
| 31 | |
| 29 |