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
zoffice
Helper I
Helper I

Default filter when no filter selected

Hi all,

 

I have a slicer of list of regions, and some table and graphs showing the indicators for each selected region.

For example, one card showing some country background text, and another visual showing the population.

 

The regions are Asia, Africa, Europe, etc.

 

The data behind is quite simple, with Region, Indicator, and Value as columns. Region is a list of regions, indicator is a list of indicators, and value is respective value, e.g. Europe, total population, xbillion.

 

When a region is selected in the slicer dropdown, the visuals show the data for that region. But when nothing is selected in the filter or selection is cleared, how can I make other graphs display "Europe" data by default?

 

I would prefer if there is a measure I can put as a filter at the page or visual level, otherwise, a measure conditionally filtering the value? 

Note that some values are strings.

 

1 ACCEPTED SOLUTION

Hi @zoffice 

I think your data model is as below.

1.png

If you want to calculate number you can use measure like Fowmy 's reply.

If you want to retrieve string values you can try my measure.

 

String = 
IF( 
    ISFILTERED('Table'[Region]),  
    MAX('Table'[Value-string]),
    CALCULATE(
         MAX('Table'[Value-string]),
        'Table'[Region] = "Europe"
    )
)

Result is as below.

By default:

2.png

Select Asia:

3.png

 

Best Regards,

Rico Zhou

 

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

6 REPLIES 6
Fowmy
Super User
Super User

@zoffice 

Please check the below formula and adjust it as per your model.
When no region is selected, it shows the Europe total and 

Fowmy_0-1608359032269.png

Your  Measure = 

IF( 
    ISFILTERED(Table6[Region]),  
    SUM(Table6[ Value-numerical]),
    CALCULATE(
        SUM(Table6[ Value-numerical]),
        Table6[Region] = "Europe"
    )
)

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
Super User

@zoffice 

Not quite sure what you means by "retrieve string values". I assume you have a dimension table with a Region Column. 

Please share some sample data based on your model and provide a clear explanation.


You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?

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

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I have added some additional columns with text values such as "High-Income", that may not work with SUM i imagine.

 

My data model structure is basically the following:

Region, Indicator, Value-numerical, value-string

Europe, Population, 1234656, ,

Europe, Income-level, , High-income

Asia, Population, 234567, ,

Asia, Income-Level, , High-income

 

Fowmy
Super User
Super User

@zoffice 

Try the following measure:

Your Measure = 

IF( 
    ISFILTERED(Table[Region]),  
    SUM(FactTable[Amount]),
    CALCULATE(
        SUM(FactTable[Amount]),
        Table[Region] = "Europe"
    )
)

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thank you!

 

How do I retrieve string values? 

Hi @zoffice 

I think your data model is as below.

1.png

If you want to calculate number you can use measure like Fowmy 's reply.

If you want to retrieve string values you can try my measure.

 

String = 
IF( 
    ISFILTERED('Table'[Region]),  
    MAX('Table'[Value-string]),
    CALCULATE(
         MAX('Table'[Value-string]),
        'Table'[Region] = "Europe"
    )
)

Result is as below.

By default:

2.png

Select Asia:

3.png

 

Best Regards,

Rico Zhou

 

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

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.

Top Solution Authors
Top Kudoed Authors