Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a table with multiple values per company and each line represents a year.
I need to calculate a one-year value (one line) divided by another year of value (other line). But these lines has no fixed year, I have a company that has the years 2015, 2014, 2013, and others that have the years 2014, 2013, 2012 and so on.
The calculation is done by the company. Do not mix one with another company.
Can someone help me?
Solved! Go to Solution.
Assuming a DataTable with columns Company, Year, and Value, and you want to get a YoY value, you can use this calculation:
YoY = [Value] / CALCULATE(MAX([Value]), FILTER('DataTable', EARLIER('DataTable'[Company]) = 'DataTable'[Company] && EARLIER('DataTable'[Year]) = 'DataTable'[Year] + 1))
This results in this output with sample data:
HTH,
Jessica
Assuming a DataTable with columns Company, Year, and Value, and you want to get a YoY value, you can use this calculation:
YoY = [Value] / CALCULATE(MAX([Value]), FILTER('DataTable', EARLIER('DataTable'[Company]) = 'DataTable'[Company] && EARLIER('DataTable'[Year]) = 'DataTable'[Year] + 1))
This results in this output with sample data:
HTH,
Jessica
Hi Jessica,
worked perfectly.
Pen include DIVIDE function, not to be written in the infinity values:
YoY = DIVIDE([Value]; CALCULATE(MAX([Value]), FILTER('DataTable', EARLIER('DataTable'[Company]) = 'DataTable'[Company] && EARLIER('DataTable'[Year]) = 'DataTable'[Year] + 1)); BLANK())
thank you so much.
User | Count |
---|---|
141 | |
70 | |
70 | |
53 | |
53 |
User | Count |
---|---|
208 | |
95 | |
64 | |
61 | |
57 |