Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
Solved! Go to 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.
Hi @lg1551 ,
When you want the slicer not to select a month or quarter, the visual is empty, such as the following.
When there's a selection in the slicer, display specific results in the table visual.
Below is the solution.
1.Create a disconnnected calculated table using dax.
2.The fields of the slicer are from Table 2.
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 )
)
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.
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
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.
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
User | Count |
---|---|
122 | |
69 | |
67 | |
58 | |
52 |
User | Count |
---|---|
183 | |
92 | |
67 | |
62 | |
52 |