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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Default message to be written when all records are selected

Hello,

 

A slight modification is required to the below DAX measure. It is working fine but I need to include a default message when all the packages (category) are selected.  I tried but its not working at all.

 

On default all categories are selected in a slicer at that time its so messy as showing all values. I need to show a message " All values selected" to the below DAX

 

Packages selected =
IF(ISBLANK(
CONCATENATEX(
VALUES(Package_To_Include[Package]),Package_To_Include[Package], ", ")),
BLANK()," Packages selected are " &
CONCATENATEX(
VALUES(Package_To_Include[Package]), Package_To_Include[Package], ","))
 
Solution taken from:
 
Thanks,
Karthik
4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Anonymous You can download the PBIX from the solution at the bottom of the Quick Measure Gallery entry. Has all the formulas, etc. If you scroll down the entire formula is listed, here is the relevant snippet (below). And yes on the Card visual.

 

VAR __TOTAL_ROWS = COUNTROWS(DISTINCT(ALL('Table'[Brand])))
VAR __CURRENT_ROWS = COUNTROWS(DISTINCT('Table'[Brand]))
VAR __MAINTEXT = 
    IF(
        __USEPERCENT,
        VAR __PERCENT = DIVIDE(__CURRENT_ROWS,__TOTAL_ROWS,0)
        RETURN IF(ISBLANK(__PERCENT),__PERCENTZEROTEXT & __PERCENTTEXT,FORMAT(__PERCENT,"Percent") & __PERCENTTEXT),
        SWITCH(
            TRUE(),
            __CURRENT_ROWS = __TOTAL_ROWS,__ALLTEXT,
            __CURRENT_ROWS = 0,__NONETEXT,

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks Greg. I will make changes and update here 🙂

Greg_Deckler
Community Champion
Community Champion

@Anonymous If I remember correctly from https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Most-Amazing-Mind-Blowing-Dynamic-Slicer-Title-Measure-Ever/td-p/429587. What I did was do a COUNTROWS('Table') and compare it with a COUNTROWS(ALL('Table')). If the 2 values are equal, then everything is selected. Might also be able to do a IF(NOT(ISFILTERED())...)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Wow @Greg_Deckler .

This is what I was actually looking for. Is it possible for you to share the formula you used over here.

 

I like the way how you are saying " You have filtered over B1, B2, B3 and 4 more brands". I will also add a similar style in mine. Have you displayed that via card visual?

 

Thanks,

Karthik

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.