Forum Discussion
Extract a single column from a Filter table on the fly
Hi everyone,
I need some help with optimizing my code for extracting a column from a filtered table on the fly. Currently, my code works, but I have a feeling that there might be a more straightforward way to achieve this. I would appreciate any suggestions or improvements you may have.
Scenario:
I have a table containing customer information, and I want to extract the customer keys for customers with the fruit "Apple."
The code I wrote is as follows, and it is currently functional:
The above code provides the desired outcome of extracting the customer keys for those with "Apple" as the fruit.
If you have any ideas on how to make this code more efficient or any alternative approaches, please let me know.
Thank you all for your help and suggestions in advance!
Cupid
- Anonymous3 years ago
Hi CupidC
IYou can create a measure
Measure = IF(SELECTEDVALUE('Customer Key'[Fruit])="Apple",1,0)Then you can use a table visual , put the key column to the visual, then put the measure to the visual filter
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi CupidC
IYou can create a measure
Measure = IF(SELECTEDVALUE('Customer Key'[Fruit])="Apple",1,0)Then you can use a table visual , put the key column to the visual, then put the measure to the visual filter
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.