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.
What is the proper way to apply (write) a DAX statement that will allow me to only show results in the data visualization, only when a user has selected 2 specific slicers.
i.e. Show dashboard as blank unless Client Name and Campaign Name have been selected.
Thank you.
Solved! Go to Solution.
Hey,
maybe my DAX statement has been a little short 🙂
So, assuming you want to show the sales amount from your sales table, you have to create a measure that returns nothing if both slicers do not have a single selection, otherwise return sales amount. Now you to create a measure like so
Sales Amount for viz = IF( AND(HASONEVALUE('tablename'[Client Name]), HASONEVALUE('tablename'[Campaign Name])) ,SUM('sales'[Sales Amount]) ,BLANK() )
Please be aware that you have to create a measure for each value that you want to visualize and that is dependent of a single selection of both slicers.
Hopefully this clarifies my previous post a little.
Regards
Tom
Hey,
this little DAX statement should do what you are looking for
IF( AND(HASONEVALUE('tablename'[Client Name]), HASONEVALUE('tablename'[Campaign Name])) ,[your measure] ,BLANK() )
Hopefully this is what you are looking for
Regards
Tom
Thanks for the help. I think this along the lines of what I want.
Where I need some help is understanding the "your measure" part.
In this case, I simply want to show the data visualizations as blank UNLESS the two slicers have been used.
Thanks again.
You may also take a look at ISFILTERED Function. Any further question, feel free to share us more details.
Hey,
maybe my DAX statement has been a little short 🙂
So, assuming you want to show the sales amount from your sales table, you have to create a measure that returns nothing if both slicers do not have a single selection, otherwise return sales amount. Now you to create a measure like so
Sales Amount for viz = IF( AND(HASONEVALUE('tablename'[Client Name]), HASONEVALUE('tablename'[Campaign Name])) ,SUM('sales'[Sales Amount]) ,BLANK() )
Please be aware that you have to create a measure for each value that you want to visualize and that is dependent of a single selection of both slicers.
Hopefully this clarifies my previous post a little.
Regards
Tom
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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |