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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
xiumi_hou
Post Partisan
Post Partisan

How to create dynamic text measure to show all the filter applied for that page?

Hello everyone,

 

I have a control page which contained 10 different filters, the filter on this page can control all the 4 tabs created in Power BI(This means, once I clicked filter A and filter B on the control tab, the entire report will only show the data of the intersection of fiter A and B).

 

What I would like to do is to create a measure - DYNAMIC MEASURE to on each tab, this will be a warning to tell the user which filter has been applied at the control filter page. For example, in the control page , I select 15-20 year old under age filter and female under gender firter, the text i would like to show is "This page is showing people who are aged 15-20 year old and age female" .Please note we have 10 filters, we may only select 1 filter , we may select mutiple, we may not select anything, this means some of the filter may show as default. 

 

Any help would be helpful. Thank you!

3 REPLIES 3
ryan_mayu
Super User
Super User

@xiumi_hou 

pls try this

Measure = 
VAR _counta=calculate(distinctcount('Table'[Age]),all('Table'[Age]))
VAR _countb=CALCULATE(DISTINCTCOUNT('Table (2)'[Gender]),all('Table (2)'[Gender]))
VAR _display=CONCATENATEX('Table','Table'[Age],",")
return if(DISTINCTCOUNT('Table'[Age])=_counta ,"Please do not select all for age",if(DISTINCTCOUNT('Table (2)'[Gender])=_countb,"Please do not select all for Gender", "This page is showing people who are aged "&_display & " year old and age" & max('Table (2)'[Gender])))

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu Thank you so much Ryan for the quick reply,. I think this solve my majority question, a quick follow up question, I saw the previous was showing "Please do not select all for AAAA". 

Ideally, if we select anything(any filter), I would like to show "

"This page is showing people who are aged "&_display & " year old and age" & max('Table (2)'[Gender])))

 below. If no filter was selected at all, I would like to show, "this page is showing all demographic population". Any thought of how to adjust the dax? The above is showing 2 filter, if I have 10 filter, and the 10 filter, some of then are coming from 1 table, some of them from different table, some of them are calculated columns, how should be apply that? Thank you so much again for your help!

@xiumi_hou 

is this what you want?

 

Measure = 
VAR _counta=calculate(distinctcount('Table'[Age]),all('Table'[Age]))
VAR _countb=CALCULATE(DISTINCTCOUNT('Table (2)'[Gender]),all('Table (2)'[Gender]))
VAR _display=CONCATENATEX('Table','Table'[Age],",")
return if(DISTINCTCOUNT('Table'[Age])=_counta ,"this page is showing all demographic population",if(DISTINCTCOUNT('Table (2)'[Gender])=_countb,"Please do not select all for Gender", "This page is showing people who are aged "&_display & " year old and age" & max('Table (2)'[Gender])))

 

1.PNG

if you have more filters, you can use the similar way. pls share the sample data and expected output ,so that we can provide you the solution.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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