Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a data field that is a multislect in the application that stores data with semicolon devider.
Product | Supplier |
123 | AAA |
234 | AAA;BBB |
345 | AAA;CCC |
567 | AAA;BBB;CCC |
I need to build a filter that would perform a search in the data table for the column 'Supplier' where filter values will be AAA or BBB or CCC a separate value. Creating additional rows by exploding the supplier column is not an option in my case.
Thanks in advance!
Solved! Go to Solution.
Hi @Cyberguy23,
One sample for your reference.
1. Create a calculated table as below and add a new calculated column in it.
Table = VALUES(Table1[Supplier])
SP = RIGHT('Table'[Supplier],3)
2. Then we can create a measure as below.
Measure = VAR _SELE = SELECTEDVALUE ( 'Table'[SP] ) RETURN CALCULATE ( SUM ( Table1[Product] ), FILTER ( Table1, SEARCH ( _SELE, Table1[Supplier], 1, 0 ) > 0 ) )
Please check the pbix as attached.
Regards,
Frank
Hi @Cyberguy23 ,
Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.
Regards,
Frank
Try using the search function in DAX
https://docs.microsoft.com/en-us/dax/search-function-dax
Something on these lines
Calculate([Your Measure],Filter(Table,search(selectedvalue(slicerfield),Table[Sullplier],1,0)>0))
What would be an example of the 'Your Measure'? I understand that I need to create this measure first that will contain all possible values in the Supplier tab? For that I created a separate table with all possible values listed as separate rows in a column that I can use but I am not sure ho to apply it in this formula.
Hi @Cyberguy23,
One sample for your reference.
1. Create a calculated table as below and add a new calculated column in it.
Table = VALUES(Table1[Supplier])
SP = RIGHT('Table'[Supplier],3)
2. Then we can create a measure as below.
Measure = VAR _SELE = SELECTEDVALUE ( 'Table'[SP] ) RETURN CALCULATE ( SUM ( Table1[Product] ), FILTER ( Table1, SEARCH ( _SELE, Table1[Supplier], 1, 0 ) > 0 ) )
Please check the pbix as attached.
Regards,
Frank
Hi @Cyberguy23 ,
Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.
Regards,
Frank
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |