The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I have a table like the following, and I want to filter it based on the selected value of the slicer. The slicer values are from a lookup table which are related to that data table on ID. I use Info column inside the slicer, for example. There is also date dimension in data table, which I don't show it here for now.
ID | item | value |
C1 | 1 | Test-C1-1 |
C1 | 2 | Test-C1-2 |
C1 | 3 | Test-C1-3 |
B1 | 1 | Test-B1-1 |
B1 | 2 | Test-B1-2 |
B1 | 3 | |
A1 | 1 | Test-A1-1 |
A1 | 2 | Test-A1-2 |
A1 | 3 | Test-A1-3 |
lookup table:
ID | Info |
A1 | InfoA1 |
B1 | InfoB1 |
C1 | InfoC1 |
I want to filter the data table based on the (single) selected value of the slicer and show only the "value" column in a multi-row card visual.
I have tried some measures like values, etc. But it doesn't work.
measure =
VAR id_first_ = FIRSTNONBLANK('lookup'[ID], 0)
RETURN
CALCULATE((VALUES('Data'[Value])), FILTER('Data', 'Data'[ID] = id_first_))
Looking forward to your help.
Hi @Anonymous ,
Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!
Hope it helps,
Community Support Team _ Caitlyn
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Make sure the value is set to 'Don't summarize':
If you've done that, it should work automatically based off the relationships - no Measure needed.
Otherwise you can see what I meant with the Card visual.
Attached file below signature.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thank you very much for your reply.
And sorry for my late reply.
I have already tried this and yes, it works nicely. But it does not fully fit my purpose.
I have multi-level hierarchy. When upper levels are selected, it shows all the items of its lower levels in the hierarchy.
What I want is: only select the values related to the package selected (at each hierarchy), whether it is up or low in the hierarchy. If blank, just show blank.
Exmaple of data (connected on "code" column):
Lookup table:
ID-Main | ID | Info | code |
Main1 | A1 | InfoA1 | Main1A1 |
Main1 | B1 | InfoB1 | Main1B1 |
Main1 | C1 | InfoC1 | Main1C1 |
Main2 | M1 | InfoM1 | Main2M1 |
Main2 | N1 | InfoN1 | Main2N1 |
Main2 | O1 | InfoO1 | Main2O1 |
Main1 | InfoMain1 | Main1 | |
Main2 | InfoMain2 | Main2 |
Data table:
ID | item | value | ID-Main | code |
C1 | 1 | Test-C1-1 | Main1 | Main1C1 |
C1 | 2 | Test-C1-2 | Main1 | Main1C1 |
C1 | 3 | Test-C1-3 | Main1 | Main1C1 |
B1 | 1 | Test-B1-1 | Main1 | Main1B1 |
B1 | 2 | Test-B1-2 | Main1 | Main1B1 |
B1 | 3 | Main1 | Main1B1 | |
A1 | 1 | Test-A1-1 | Main1 | Main1A1 |
A1 | 2 | Test-A1-2 | Main1 | Main1A1 |
A1 | 3 | Test-A1-3 | Main1 | Main1A1 |
M1 | 1 | Test-M1-1 | Main2 | Main2M1 |
M1 | 2 | Test-M1-2 | Main2 | Main2M1 |
M1 | 3 | Test-M1-3 | Main2 | Main2M1 |
N1 | 1 | Test-N1-1 | Main2 | Main2N1 |
N1 | 2 | Main2 | Main2N1 | |
N1 | 3 | Test-N1-3 | Main2 | Main2N1 |
1 | Test-Main2-1 | Main2 | Main2 | |
2 | Test-Main2-2 | Main2 | Main2 | |
3 | Test-Main2-3 | Main2 | Main2 |
Example of unwated outcome:
Example of desired outcome:
@Anonymous
I'm not sure Multi Row Card will give you what you want, it looks like your values are descriptive.
You can try this MEASURE in a card visual:
Value List = CONCATENATEX( VALUES('Data'[Value]) , 'Data'[Value], ", " )
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thank you very much.
No, card is not suitable for my task.
I just want a multi-row card to show filtered rows of value column.
There should be a way, for example by filtering/summarizing the table, and then show that? I'm not sure.
@Anonymous Have you tried my measure? It lists all the rows, separated by comma.
There is no way to show the filtered rows in a card visual without adding a unique ID or category value. I'll mock up a sample file for you, just give me a few minutes...
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com