Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
irnm8dn
Post Prodigy
Post Prodigy

HASONEFILTER Quesion - DAX Help (Show results when slicers have been used.)

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.

1 ACCEPTED 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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

@TomMartens

 

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.

@irnm8dn,

 

You may also take a look at ISFILTERED Function. Any further question, feel free to share us more details.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.