Forum Discussion
Dynamic Set operations - Intersection, Union in a visual based on user date selections
- 2 years ago
Hey ashishd ,
here, you will find your pbix that now contains two measures and a new table: https://tommartens-my.sharepoint.com/:u:/g/personal/tom_minceddata_com/EQd2IMfzWjRAqvPx1pUeNGYBEjo-UJVxHBVvprbE2PI2yA?e=eD56Jo
Please be aware that my approach is using only the date table Date1 that is NOT connected to the "fact" table Sheet1.
The additional table is simple: it provides a "simple" llist of joinjypes, that i use as a slicer. This allows a user to select a join type, currently I have the join tpyes implemented:
- intersect
- leftanti (items only available in the first date)
- rightanti (items only available in the second date)
There is a simple measure "vizAid DateSelection" that shows a text depending on the the number of selected dates.
The not so simple measure "Measure" basically creates two tables containing different sets of items.
Depending of the selected join type one condition of the FILTER function will be activated. This approach is necessary because DAX does not allow that a table or column object can be created in the TRUE or FALSE branch of a conditional statement like IF or SWITCH.
This is how my adaption looks like:
Hopefully this provides what you are looking for.
Regards,Tom
Hey ashishd ,
consider creating a pbix file that contains sample data, but still reflects your semantic model (tables, relationships, calculated clumns, and measures). Upload the pbix to OneDrive, Google Drive, or dropbox and share the link. If you are using a spreadsheet to create the sample data, instead of manual input method, share the spreadsheet as well.
Regards,
Tom
Hey TomMartens ,
Please check this shared folder with required files:
https://drive.google.com/drive/folders/1KQW-EHwtnl74htwmaiuV1NWrL6GeIKZx?usp=sharing
Thank you!
Ashish
- TomMartens2 years agoSuper User
Hey ashishd ,
here, you will find your pbix that now contains two measures and a new table: https://tommartens-my.sharepoint.com/:u:/g/personal/tom_minceddata_com/EQd2IMfzWjRAqvPx1pUeNGYBEjo-UJVxHBVvprbE2PI2yA?e=eD56Jo
Please be aware that my approach is using only the date table Date1 that is NOT connected to the "fact" table Sheet1.
The additional table is simple: it provides a "simple" llist of joinjypes, that i use as a slicer. This allows a user to select a join type, currently I have the join tpyes implemented:
- intersect
- leftanti (items only available in the first date)
- rightanti (items only available in the second date)
There is a simple measure "vizAid DateSelection" that shows a text depending on the the number of selected dates.
The not so simple measure "Measure" basically creates two tables containing different sets of items.
Depending of the selected join type one condition of the FILTER function will be activated. This approach is necessary because DAX does not allow that a table or column object can be created in the TRUE or FALSE branch of a conditional statement like IF or SWITCH.
This is how my adaption looks like:
Hopefully this provides what you are looking for.
Regards,Tom