Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
I want to create a measure for the highest value and 2nd highest value of Delivery Country. In the matrix below, Net Sales PY ('Sales' [Net Sales PY]) are displayed by Width ('Product'[Width]) and by Delivery Country ('Address'[Country ISO]). What I try to create in this matrix is a column next to Net Sales PY with the highest value of Delivery Country ('Address'[Country ISO]). So, in this case for Width=320, Delivery Country "DE" needs to be shown (Other countries as Blank()). I would also need an extra column with 2nd highest value of Delivery Country ('Address'[Country ISO]). So, in this case for Width=320, Delivery Country "BE" needs to be shown.
It needs to be dynamic. So when I select other customers, it needs to take into account all possible Delivery Countries.
@amitchandak , when I create your measure it shows exactly the same values as [Net Sales PY] because it's already sorted by Width and Country ISO. What I'm trying to get is the Country ISO for the maximum value. For example, [Net Sales PY] of Width "320" and Country ISO "DE" is 237.338,73 --> measure needs to show the max value of Country ISO. So, "DE" in this case. The second measure needs to do the same but for the 2nd highest value of Country ISO ("BE" in this case).
Thanks in advance!
@DM_95 , Try a measure like
calculate([Net Sales PY], TOPN(2, allselected('Address'[Country ISO]), [Net Sales PY],desc), values('Address'[Country ISO]))
TOPN: https://youtu.be/QIVEFp-QiOk
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
108 | |
101 | |
93 | |
69 |
User | Count |
---|---|
172 | |
135 | |
132 | |
101 | |
95 |