The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello, I need to calculate the percentage change of the column "2022" on "2021". Both columns with part of the same field that is called "Year".
Thanks a lot
Solved! Go to Solution.
Hi @Syndicate_Admin ,
I think your data maybe like this:
Create a new column to calculate the percentage change of the column "2022" on "2021":
Percentage =
var year_2021 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year] = 2021 && 'Table'[ID] = EARLIER('Table'[ID])))
var year_2022 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year] = 2022 && 'Table'[ID] = EARLIER('Table'[ID])))
return
DIVIDE(year_2022 - year_2021,year_2021)
I think this is the result you want:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
I think your data maybe like this:
Create a new column to calculate the percentage change of the column "2022" on "2021":
Percentage =
var year_2021 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year] = 2021 && 'Table'[ID] = EARLIER('Table'[ID])))
var year_2022 = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Year] = 2022 && 'Table'[ID] = EARLIER('Table'[ID])))
return
DIVIDE(year_2022 - year_2021,year_2021)
I think this is the result you want:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you post sample data as text?
please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables
Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/
User | Count |
---|---|
56 | |
54 | |
53 | |
47 | |
30 |
User | Count |
---|---|
175 | |
88 | |
69 | |
48 | |
47 |