Forum Discussion
EuroK4238
2 years agoFrequent Visitor
PowerBI Percentage Difference between two selected dates in a filter
Hi, I'm new to PowerBI and so far ChatGPT has been my best friend, but it seems it has exhausted its usefulness because we're going around in circles with the same proposed solutions. what i am...
ahadkarimi
Solution Specialist
2 years agoHi EuroK4238, try these measures below, and if you encounter any issues, let me know.
ValueAncientDate =
CALCULATE(
SUM('Balance Unpivot'[Values]),
FILTER(
'Balance Unpivot',
'Balance Unpivot'[DATE] = [AncientDate]
&& 'Balance Unpivot'[Attribute] = SELECTEDVALUE('Balance Unpivot'[Attribute])
)
)
ValueRecentDate =
CALCULATE(
SUM('Balance Unpivot'[Values]),
FILTER(
'Balance Unpivot',
'Balance Unpivot'[DATE] = [RecentDate]
&& 'Balance Unpivot'[Attribute] = SELECTEDVALUE('Balance Unpivot'[Attribute])
)
)Calculate the percentage change:
PercentageChange =
DIVIDE(
[ValueRecentDate] - [ValueAncientDate],
[ValueAncientDate],
0
)
Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Supplier!
- EuroK42382 years agoFrequent Visitor
Hi, thank you for your quick response.
I tried your proposed solution, but PerecentageChange comes up as zero for all attributes, same as the solutions proposed by ChatGPT.