Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
 
					
				
		
Sorry if this is a dumb question, but I've been studying Power BI and I am quite lost. I would like to build a profitability line chart, where my X axis is a date, my Y axis (values) is a percentage of increase, and my legend is a name. I will use an example of stock prices:
Id Name Date Value
| 1 | ABC | 22/07/2019 | 10.37 | 
| 2 | F1 | 22/07/2019 | 1.99 | 
| 3 | ABC | 23/07/2019 | 10.42 | 
| 4 | F1 | 23/07/2019 | 2.07 | 
If I plot the table above, the value of stock ABC is much higher than F1, so the lines will not be easily comparable. It is usual, in such scenario, to plot the profitability in % of these stocks.
How do I achieve this? Thanks in advance
Solved! Go to Solution.
Hi @Anonymous
Assuming that your data looks like your sample the following formula should work.
Change from Prior = divide(sum('Table1'[Value]), 
CALCULATE(sum(Table1[Value]), 
-- remove Data filter context on x axis
FILTER(ALL(Table1[Date]), 
-- get record for prior date
'Table1'[Date] = DATEADD(VALUES(Table1[Date]), -1, DAY))), 
--set divide by zero value to 1 to ensure that the -1 one part of the equation does not return -100% when denom is 0
1)-1I hope this helps,
Richard
Proud to be a Super User!
Hi @Anonymous
Assuming that your data looks like your sample the following formula should work.
Change from Prior = divide(sum('Table1'[Value]), 
CALCULATE(sum(Table1[Value]), 
-- remove Data filter context on x axis
FILTER(ALL(Table1[Date]), 
-- get record for prior date
'Table1'[Date] = DATEADD(VALUES(Table1[Date]), -1, DAY))), 
--set divide by zero value to 1 to ensure that the -1 one part of the equation does not return -100% when denom is 0
1)-1I hope this helps,
Richard
Proud to be a Super User!
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 84 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |