The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi friends,
I'm trying to get a text display in a card box, based on the filters that I'm choosing on the screen.
But my problem is: when I choose a specific filter under a macro filter, my DAX formula keeps me returning the macro and not the specific filter.
For instance:
I would like to display "AMERICA" instead of "INTERNATIONAL", but the value "AMERICA" belongs to "INTERNATIONAL".
My measure is currently:
The table structure is basically:
COLUMN 1 (MACRO) | COLUMN 2 (MARKET) |
INTERNATIONAL | AFRICA |
INTERNATIONAL | EUROPE |
INTERNATIONAL | EURASIA |
INTERNATIONAL | ASIA |
INTERNATIONAL | AMERICA |
HALAL | MIDDLE EAST |
Does anyone know how to fix this?
Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
I tried using the function ISFILTERED, even if the filters are on the same tables, and it did work here!
This is my code:
HI @Anonymous,
Did these filter use the same table field as source? AFAIK, current power bi filters does not support to get different values from the filters that used same table feild as source .
If they are from different fields, you can use ISFILTERED function to trace the selections and as conditions to use in if statements.
ISFILTERED function (DAX) - DAX | Microsoft Learn
Notice: current power bi use 'AND' logic to link different filters, if you want to achieve some customize filter effects, please create unconnected tables(not has relationship to current table relationships) as source of filter.
Regards,
Xiaoxin Sheng
Hi @Anonymous , thank you for your reply,
Yes, both filters "Macro Markets" and "Market" are in the same table,
COLUMN 1 (MACRO) | COLUMN 2 (MARKET) |
INTERNATIONAL | AFRICA |
INTERNATIONAL | EUROPE |
INTERNATIONAL | EURASIA |
INTERNATIONAL | ASIA |
INTERNATIONAL | AMERICA |
HALAL | MIDDLE EAST |
Hi @Anonymous ,
I tried using the function ISFILTERED, even if the filters are on the same tables, and it did work here!
This is my code:
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |