cancel
Showing results for 
Search instead for 
Did you mean: 
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
RicoZhou
Community Support
Community Support

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 IV
Super User IV

@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


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

Fowmy
Super User IV
Super User IV

@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


Blog - Data Visualization

Website   YouTube    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 IV
Super User IV

@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


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

Thank you!

 

How do I retrieve string values? 

RicoZhou
Community Support
Community Support

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

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps