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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
ssk_1984
Helper I
Helper I

Default value to be show on visuals by measure slicer filter

Hi All,

Help to create a measure to show the default value as for category B in visuals for the first time, any selection happen on category slicer automatically the respective values show show on the visual

Catgory Slicer Category 
A A 
A B 
B C 
B   
C   
C  Cou t of category
  Card Default Value2

 

Thanks in advance

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @ssk_1984,

 

Can you please try this approach:

 

Measure = 
VAR SelectedCategory = SELECTEDVALUE('Category'[Slicer Category])
VAR DefaultValue = CALCULATE(COUNTROWS('Category'), 'Category'[Slicer Category] = "B")
RETURN 
    IF(ISBLANK(SelectedCategory), DefaultValue, CALCULATE(COUNTROWS('Category'), 'Category'[Slicer Category] = SelectedCategory))

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

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @ssk_1984 ,

 

Did Sahir_Maharaj's workaround help you?

If not, you may refer to this blog:

How to dynamically select the default values we ne... - Microsoft Fabric Community

Or provide us with more details about your requirements, thanks.

 

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.

 

Sahir_Maharaj
Super User
Super User

Hello @ssk_1984,

 

Can you please try this approach:

 

Measure = 
VAR SelectedCategory = SELECTEDVALUE('Category'[Slicer Category])
VAR DefaultValue = CALCULATE(COUNTROWS('Category'), 'Category'[Slicer Category] = "B")
RETURN 
    IF(ISBLANK(SelectedCategory), DefaultValue, CALCULATE(COUNTROWS('Category'), 'Category'[Slicer Category] = SelectedCategory))

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors