- 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

Exclude part of the data in a measure for all the data except the part itself
Hi all!
I have a problem and I hope someone can help me.
I have a tabel with 3 columns "Group","Qestion", "Response" like this (and so on)
Group 1 | Q1_G1 | 1 |
Group 1 | Q1_G1 | 2 |
Group 1 | Q2_G1 | 3 |
Group 2 | Q1_G2 | 4 |
Group 3 | Q1_G3 | 8 |
Group 2 | Q1_G2 | 1 |
Group 2 | Q2_G3 | 10 |
Group 3 | Q2_G3 | 0 |
I have this measure:
num_good = CALCULATE(
COUNT('Table1'[Response]),
FILTER('Table1','Table1'[Response]>=9))
I want to modify this measure in such a way that it continues to perform the same calculation excluding the 'Question' equal to 'Q1_G1' and that for the 'Question' 'Q1_G1' it excludes everything else. Is it possible?
Thanks all!
Seba
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi, @SebaSpotti
Based on your description, I used the following example data:
Create the following measure:
num_good =
SUMX(
VALUES('Table'[Qestion]),
IF(
'Table'[Qestion] = "Q1_G1",
CALCULATE(
COUNT('Table'[Response]),
FILTER(
'Table',
'Table'[Response] >= 9 && 'Table'[Qestion]= "Q1_G1"
)
),
CALCULATE(
COUNT('Table'[Response]),
FILTER(
'Table',
'Table'[Response] >= 9 &&'Table'[Qestion] <> "Q1_G1"
)
)
)
)
Here are the results:
If you have any questions, please feel free to ask me.
Best Regards
Jianpeng Li
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, @SebaSpotti
Based on your description, I used the following example data:
Create the following measure:
num_good =
SUMX(
VALUES('Table'[Qestion]),
IF(
'Table'[Qestion] = "Q1_G1",
CALCULATE(
COUNT('Table'[Response]),
FILTER(
'Table',
'Table'[Response] >= 9 && 'Table'[Qestion]= "Q1_G1"
)
),
CALCULATE(
COUNT('Table'[Response]),
FILTER(
'Table',
'Table'[Response] >= 9 &&'Table'[Qestion] <> "Q1_G1"
)
)
)
)
Here are the results:
If you have any questions, please feel free to ask me.
Best Regards
Jianpeng Li
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

Try this patter:
IF(
SELECTEDVALUE(Table[Column]) = "Q1_G1",
CALCULATE([num_good],
Table[Column] = "Q1_G1",
CALCULATE([num_good],
Table[Column] <> "Q1_G1")))
If this works for you, kindly mark as solution so it's easier for anyone with similar challenges to find the solution.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
08-13-2024 07:28 AM | |||
05-19-2023 09:18 AM | |||
01-10-2023 03:59 PM | |||
03-11-2024 06:29 AM | |||
07-16-2024 11:24 AM |