Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
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.
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.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 69 | |
| 32 | |
| 32 | |
| 32 |