- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Need help on Dax_Return a specified value if all options are selected in the filter
Hi,
Really appreciate it if you could help me on the dax to return the following result.
I want the return result to show the Ctry value of 74% if all countries are selected in the country filter.
Country Filter |
SG |
CN |
KR |
UK |
IN |
IN |
MY |
TH |
Data Table | |
Country | share% |
SG | 78% |
CN | 75% |
KR | 89% |
UK | 67% |
IN | 70% |
Ctry | 74% |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Hong_HW
Thanks for the reply from @Jihwan_Kim , please allow me to provide another insight:
@Hong_HW , the following methods are for your reference.
Create a measure as follow
Measure =
VAR _ctry = CALCULATE(SUM('Data Table'[share%]), FILTER('Data Table', [Country] = "Ctry"))
VAR _share = CALCULATE(SUM('Data Table'[share%]), FILTER('Data Table', [Country] = SELECTEDVALUE(Country[Country])))
RETURN
IF(NOT(ISFILTERED(Country[Country])), _ctry, _share)
Output:
In the above formula, if you select a country, it returns the "share%" of the corresponding country, you can modify it according to your needs.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Hong_HW
Thanks for the reply from @Jihwan_Kim , please allow me to provide another insight:
@Hong_HW , the following methods are for your reference.
Create a measure as follow
Measure =
VAR _ctry = CALCULATE(SUM('Data Table'[share%]), FILTER('Data Table', [Country] = "Ctry"))
VAR _share = CALCULATE(SUM('Data Table'[share%]), FILTER('Data Table', [Country] = SELECTEDVALUE(Country[Country])))
RETURN
IF(NOT(ISFILTERED(Country[Country])), _ctry, _share)
Output:
In the above formula, if you select a country, it returns the "share%" of the corresponding country, you can modify it according to your needs.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for the clear explanation.
It works for me, really appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I assume the implicit measure is used in the visualizations.
Please try create a measure (explicit measure) by using AVERAGE DAX function.
Please refer to the link down below.
Tutorial: Create your own measures in Power BI Desktop - Power BI | Microsoft Learn
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for the reply.
But the average measure will not give me the correct result.
Ctry 74% is not the average of all countries.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
05-30-2024 03:33 PM | |||
09-20-2024 05:38 AM | |||
07-30-2024 12:36 PM | |||
06-06-2024 07:38 AM | |||
09-03-2024 07:18 AM |
User | Count |
---|---|
14 | |
14 | |
11 | |
11 | |
8 |