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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Umadhandapani
Helper II
Helper II

Filter Selection

Umadhandapani_0-1642576202537.png

Required a measure where selecting  'Germany' filter it should return 'SalesvsProfit' value, if selecting any of the filter other than 'Germany' it should return blank.

 

In the above concept, if I multi-select 'Germany' along with 'Mexico' it should sum up with 'Germany' value + '0', to result the value. Is it possible?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Umadhandapani ,

 

Please try:

Measure = 
var _count=IF(ISFILTERED('Table'[Country]), COUNTX(ALLSELECTED('Table'[Country]),[Country]),0)
var _ifselected=SUMMARIZE(ALLSELECTED('Table'),[Country])
return SWITCH(TRUE(), _count=1 && MAX('Table'[Country])="Germany", [SalesvsProfit], _count>1 && "Germany" in _ifselected , [SalesvsProfit]+0,BLANK())

if contains germany.gif

If you want to actually show the "+0 " , please try:

Measure 2 (Text) = 
var _count=IF(ISFILTERED('Table'[Country]), COUNTX(ALLSELECTED('Table'[Country]),[Country]),0)
var _ifselected=SUMMARIZE(ALLSELECTED('Table'),[Country])
return 
SWITCH(TRUE(), _count=1 && MAX('Table'[Country])="Germany",CONVERT( [SalesvsProfit],STRING), _count>1 && "Germany" in _ifselected , [SalesvsProfit] &" + 0",BLANK())

But the measure type is text instead of Int:

Eyelyn9_0-1642993310917.png

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Umadhandapani ,

 

Please try:

Measure = 
var _count=IF(ISFILTERED('Table'[Country]), COUNTX(ALLSELECTED('Table'[Country]),[Country]),0)
var _ifselected=SUMMARIZE(ALLSELECTED('Table'),[Country])
return SWITCH(TRUE(), _count=1 && MAX('Table'[Country])="Germany", [SalesvsProfit], _count>1 && "Germany" in _ifselected , [SalesvsProfit]+0,BLANK())

if contains germany.gif

If you want to actually show the "+0 " , please try:

Measure 2 (Text) = 
var _count=IF(ISFILTERED('Table'[Country]), COUNTX(ALLSELECTED('Table'[Country]),[Country]),0)
var _ifselected=SUMMARIZE(ALLSELECTED('Table'),[Country])
return 
SWITCH(TRUE(), _count=1 && MAX('Table'[Country])="Germany",CONVERT( [SalesvsProfit],STRING), _count>1 && "Germany" in _ifselected , [SalesvsProfit] &" + 0",BLANK())

But the measure type is text instead of Int:

Eyelyn9_0-1642993310917.png

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

amitchandak
Super User
Super User

@Umadhandapani , a new measure

if( selectedvalues(Table[Country]) = "Germany", [SalesvsProfit], blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors