Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everybody,
I get stuck with one issue.
I have the following table visual.
The "Customers" are taken from the dataset. The "Price" is calculated with a measure that is dependent on a SelectedValue Slicer.
However, only the Price of "Customer A" is changed/ adjusted there.
The Rank ist calculated with a measure that uses the value of the "Price".
I now need a DAX-command that outputs the Rank of "Customer A" so that I can display it on a card.
I've already tried and used the measure for the rank and finally applied a filter to the visual (card). However, this works because the measure calculated the "Rank" only with the "Customer A". "Customer A" is therefore always in first place.
Thank you for your help!
Kind regards
Michael
Solved! Go to Solution.
// Maybe something like this...
[Customer A Rank] =
var VisibleCustomers =
CALCULATETABLE(
DISTINCT( T[Customer] ),
ALLSELECTED( Customer )
)
RETURN
CALCULATE(
RANKX(
VisibleCustomers,
[Price],,
ASC, DENSE
),
T[Customer] = "A"
)
// Maybe something like this...
[Customer A Rank] =
var VisibleCustomers =
CALCULATETABLE(
DISTINCT( T[Customer] ),
ALLSELECTED( Customer )
)
RETURN
CALCULATE(
RANKX(
VisibleCustomers,
[Price],,
ASC, DENSE
),
T[Customer] = "A"
)
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |