Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello all,
I am trying to calculate dynamically the percent difference using Price values from the same column and using filter context from two different columns (Month and Type)
I have been trying this measures formula below but I am sure my DAX is off.
Month | Type | Price |
Mar | Income | $1000 |
Mar | Expense | $500 |
April | Income | $300 |
April | Expense | $800 |
Hi @trying2learnpbi ,
Is your problem solved? If it is solved, you can mark the correct answer as a marker, if it is not solved, you can provide detailed information we can help you better.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @trying2learnpbi ,
I hope this below Measures will help you,
Measure 1:
Measure 2:
Measure 3:
Dynamically it will work.
Best Regards,
Ajith Kumar
If it solves your issue, please accept it as the solution to help the other members find it more quickly.
@Ajithkumar_03 thanks for your reply. I tried your format but am getting the error below. It is weird since the Type column has two values (income and expense).
My observation is that for your Expense Calc measure, you do not need to input hard corded "April" month, and similarly for your Income Calc, you do not need the hard coded "April" month filtering.
Your [percent diff] measure is just the margin and I wouldn't call it as percent diff as it is not describing what it is.
@DataNinja777 thanks for the reply. I tried removing April but am getting error message (see screenshot below). Any help would be appreciated.
Dax is like an excel formula. You can delete the blue crossed out part.
Best regards,
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |