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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
rob_vander2
Frequent Visitor

Show report only when value is selected from filter pane

Hi All,

I have one table report column Country and masure sales. I have included same country dimension in in page level filter pane. I want to show this report only when country is is selected from filter pane, otherwise should be blank. I tried with ISFILTERED but it's not working as Dimension is already in filter conetxt of this table visual. How can I achieve this?

1 ACCEPTED SOLUTION

Hi @rob_vander2 ,
According to your new requirement, you want to be able to filter multiple cities can also be displayed is it, you can try the following code, hope it can help you!

Display Sales @ = 
IF(
    CALCULATE(ISFILTERED('Countries_Table'[Country]),ALLSELECTED('Sales_Table')),
    SUM('Sales_Table'[SalesAmount]),
 BLANK()
    
)

vxingshenmsft_0-1736997035684.png

 

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

7 REPLIES 7
v-xingshen-msft
Community Support
Community Support

Hi All,
Firstly  Sahir_Maharaj thank you for your solution!

And @rob_vander2 ,Since in the screening process, if you do not select any city, the default logic is that you select all cities, so then in this case, we need to add a little restriction to ensure that the logic works properly.

Display Sales @ = 
IF(
    CALCULATE(HASONEVALUE('Countries_Table'[Country]),ALLSELECTED('Sales_Table')),
    SUM('Sales_Table'[SalesAmount]),
 BLANK()
    
)

vxingshenmsft_0-1736744723640.png

vxingshenmsft_1-1736744735650.png

If you have further questions, check out the pbix file I uploaded and I would be extremely proud if my solution solves your problem!

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-xingshen-msft  Problem is I should be able to select multiple countries as well. In this case hasonevalue restricting to select only one country

Hi @rob_vander2 ,
According to your new requirement, you want to be able to filter multiple cities can also be displayed is it, you can try the following code, hope it can help you!

Display Sales @ = 
IF(
    CALCULATE(ISFILTERED('Countries_Table'[Country]),ALLSELECTED('Sales_Table')),
    SUM('Sales_Table'[SalesAmount]),
 BLANK()
    
)

vxingshenmsft_0-1736997035684.png

 

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

rob_vander2
Frequent Visitor

@Sahir_Maharaj  Also, your solution doesn't seem to be working. When I put your DAX in the report, by default I can still see the report for all countries instead of blank

Hello @rob_vander2,

 

Thanks for your response. 

 

Can you please try these updated approaches:

 

Show Report = 
IF(
    ISFILTERED('Country'[Country]),
    [Sales Amount],
    BLANK()
)

 

IF(
    HASONEVALUE('Dim_country'[Country]),
    [Sales Amount],
    BLANK()
)

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

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
rob_vander2
Frequent Visitor

@Sahir_Maharaj  Thanks for the reply. I have kind of got the solution with below DAX measure and it works. Could you tell me which one will be better?

if( COUNTROWS(ALLSELECTED('Dim_country'[Country])) < COUNTROWS(ALL('Dim_country'[Country])),
[Sales Amount],BLANK())
Sahir_Maharaj
Super User
Super User

Hello @rob_vander2,

 

Can you please try this approach:

Show Report = 
IF(
    HASONEVALUE('Country'[Country]),
    CALCULATE(
        SUM('SalesTable'[Sales]),
        FILTER(
            ALL('Country'),
            'Country'[Country] IN VALUES('Country'[Country])
        )
    ),
    BLANK()
)

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

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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