Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 @vitornmind
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)-1
I hope this helps,
Richard
Proud to be a Super User!
Hi @vitornmind
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)-1
I hope this helps,
Richard
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |