Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have a Table visual that displays a code and its associated description. I am able to rank the code according to its frequency using the following DAX expression:
[Selected Tariff View] = COUNT('Claims Fact'[Tariff Code ID])
Rank Tariff by Selected View = IF(
HASONEVALUE('Tariff Dimension'[Tariff Code]);
RANKX(
ALLSELECTED('Tariff Dimension'[Tariff Code]);
[Selected Tariff View]
)
)
Here is the result:
I now add the associated description to the Table visual. But when I do, I loose the rank. Here is what happens:
What am I doing wrong?
Thanks..
Solved! Go to Solution.
Hi @Anonymous
Add Tarriff Description as a parameter
Rank Tariff by Selected View =
IF (
HASONEVALUE ( 'Tariff Dimension'[Tariff Code] ),
RANKX (
ALL ( 'Tariff Dimension'[Tariff Code], 'Tariff Dimension'[Tariff Description] ),
[Selected Tariff View]
)
)
Hi,
Also, you may want to explore the LOOKUPVALUE() function to bring over the description field into your Table.
Hi @Anonymous
Add Tarriff Description as a parameter
Rank Tariff by Selected View =
IF (
HASONEVALUE ( 'Tariff Dimension'[Tariff Code] ),
RANKX (
ALL ( 'Tariff Dimension'[Tariff Code], 'Tariff Dimension'[Tariff Description] ),
[Selected Tariff View]
)
)
Hi @Zubair_Muhammad,
I see you have used 'ALL' which gives you the option of adding another parameter instead of 'ALLSELECTED', which is what I am using but doesnt give the option of additional parameters.
I am using 'ALLSELECTED' as I want to maintain the filter context of any filters already selected. Is there any way to do what you have suggested but with keeping the Filter context of any filters already selected?
Thanks
HI @Anonymous
Interesting...
Could you show how it impacts your results?.....The incorrect result and result you expect
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 130 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |