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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
lg1551
Resolver II
Resolver II

Use a Default Measure When Slicer is Set to 'All'

I have a Quarter/Month Hierarchy Slicer.

 

By Default, the slicer is set to "All", meaning nothing is selected in the slicer. When it is in this state, I want the visual to display a specific measure.

 

If the user selects a Month or Quarter from the slicer or multiple Months or Quarters, I want it to use a different measure.

 

I've tried, SELECTED VALUE, HASONEFILTER, HASONEVALUE,and ISFILTERED. 

 

But it seems Power BI thinks the slicer is in fact filtered, when nothing is selected.

 

What I'm looking for is a default visual display when nothing is selected, but the visual can be customized as the user selects Quarters or Months.

 

Thank you.

1 ACCEPTED SOLUTION

Thanks for the reply. I was actually able to get this sorted out. 

 

What I was after, was for the visual to use a default measure, when the slicer has nothing or "All" selected. I was able to achieve this via some DAX.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @lg1551 ,

 

When you want the slicer not to select a month or quarter, the visual is empty, such as the following.

vstephenmsft_0-1675925262760.png

When there's a selection in the slicer, display specific results in the table visual.

vstephenmsft_1-1675925293817.png

Below is the solution.

1.Create a disconnnected calculated table using dax. 

vstephenmsft_2-1675925367217.png

2.The fields of the slicer are from Table 2.

vstephenmsft_3-1675925432242.png

3.Create measure as the visual-level filter. Put it into the table visual and set up show items when the value is 1. And then the expected you want is done.

 

Measure =
IF (
    ISFILTERED ( 'Table 2'[Quarter] ) || ISFILTERED ( 'Table 2'[Month] ),
    IF ( MAX ( 'Table'[Month] ) IN ALLSELECTED ( 'Table 2'[Month] ), 1 )
)

 

16.png

The key is to create a disconnected table.

You can download my attachment for more details.

 

Best Regards,

Stephen Tao

 

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

Thanks for the reply. I was actually able to get this sorted out. 

 

What I was after, was for the visual to use a default measure, when the slicer has nothing or "All" selected. I was able to achieve this via some DAX.

AllisonKennedy
Community Champion
Community Champion

@lg1551 

 

You need to determine how many values the slicer has without filters, then compare to how many it has in current context:

 

Measure = 
VAR _CountAllOptions = CALCULATE( countrows( values ( table[column] ) ), ALL() )

VAR _CountCurrentOptions = countrows( values ( table[column] ) )

VAR _Result = IF( _CountAllOptions = _CountCurrentOptions, [Default Measure], [Other Measure] )


RETURN
_Result


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

I had the original measure and I created 2 additional measures.

 

Measure 1: This measure displays the data as I want it displayed in default state (no slicer selection).

Measure 2: This is a measure that uses an IF statement. If(selectedvalue('slicer')=Blank(), Measure 1, Original Measure.

Thanks for the reply. I was actually able to get this sorted out. 

 

What I was after, was for the visual to use a default measure, when the slicer has nothing or "All" selected. I was able to achieve this via some DAX.

@lg1551  Can you please share the DAX that you've used so others can benefit? I'd also be interested to learn how it differs from the DAX I suggested to you. 

 

Thanks! and glad you got it solved. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.