Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I want to count all the fields from SQD1-SQD0 to be used in the formula later.
SQD1 | SQD2 | SQD3 | SQD4 | SQD5 | SQD6 | SQD7 | SQD8 |
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
4 | 4 | 4 | 0 | 0 | 4 | 4 | 4 |
4 | 4 | 0 | 5 | 4 | 5 | 4 | 5 |
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4 | 4 | 0 | 4 | 0 | 4 | 5 | 4 |
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 0 | 4 | 4 | 5 |
4 | 4 | 4 | 4 | 5 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 0 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 0 | 4 | 4 | 4 |
4 | 4 | 4 | 4 | 0 | 4 | 4 | 4 |
I want to the total count to be 128. im using this formula
VAR TotalRespondents = CALCULATE( COUNTROWS( FILTER( 'Sample', NOT ISBLANK('Sample'[SQD1]) || NOT ISBLANK('Sample'[SQD2]) || NOT ISBLANK('Sample'[SQD3]) || NOT ISBLANK('Sample'[SQD4]) || NOT ISBLANK('Sample'[SQD5]) || NOT ISBLANK('Sample'[SQD6]) || NOT ISBLANK('Sample'[SQD7]) || NOT ISBLANK('Sample'[SQD8]) ) ) )
Thanx in advnace |
Solved! Go to Solution.
Hi @Boopep,
Thank you for reaching out to Microsoft Fabric Community.
It looks like the issue here comes from using && to check if all 8 fields in a row are exactly 5 or 4, this condition is too restrictive and excludes valid cases where the row contains a mix of 4s and 5s.
To count the percentage of all responses across SQD1 to SQD8 use this below advanced measure to scan each row and each field:
ANOTHER_SQD_1_8_FIXED =
VAR AgreeOrStronglyAgreeCount =
SUMX (
'Sample',
VAR ValuesList = {
'Sample'[SQD1], 'Sample'[SQD2], 'Sample'[SQD3], 'Sample'[SQD4],
'Sample'[SQD5], 'Sample'[SQD6], 'Sample'[SQD7], 'Sample'[SQD8]
}
RETURN
COUNTAX (
FILTER (
ValuesList,
[Value] IN {4, 5}
),
1
)
)
VAR ValidResponseCount =
SUMX (
'Sample',
VAR ValuesList = {
'Sample'[SQD1], 'Sample'[SQD2], 'Sample'[SQD3], 'Sample'[SQD4],
'Sample'[SQD5], 'Sample'[SQD6], 'Sample'[SQD7], 'Sample'[SQD8]
}
RETURN
COUNTAX (
FILTER (
ValuesList,
[Value] <> 0
),
1
)
)
RETURN
DIVIDE(AgreeOrStronglyAgreeCount, ValidResponseCount)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
This is my DAX Measure
The correct result of this shoud be 100%
Hi @Boopep,
Thank you for reaching out to Microsoft Fabric Community.
It looks like the issue here comes from using && to check if all 8 fields in a row are exactly 5 or 4, this condition is too restrictive and excludes valid cases where the row contains a mix of 4s and 5s.
To count the percentage of all responses across SQD1 to SQD8 use this below advanced measure to scan each row and each field:
ANOTHER_SQD_1_8_FIXED =
VAR AgreeOrStronglyAgreeCount =
SUMX (
'Sample',
VAR ValuesList = {
'Sample'[SQD1], 'Sample'[SQD2], 'Sample'[SQD3], 'Sample'[SQD4],
'Sample'[SQD5], 'Sample'[SQD6], 'Sample'[SQD7], 'Sample'[SQD8]
}
RETURN
COUNTAX (
FILTER (
ValuesList,
[Value] IN {4, 5}
),
1
)
)
VAR ValidResponseCount =
SUMX (
'Sample',
VAR ValuesList = {
'Sample'[SQD1], 'Sample'[SQD2], 'Sample'[SQD3], 'Sample'[SQD4],
'Sample'[SQD5], 'Sample'[SQD6], 'Sample'[SQD7], 'Sample'[SQD8]
}
RETURN
COUNTAX (
FILTER (
ValuesList,
[Value] <> 0
),
1
)
)
RETURN
DIVIDE(AgreeOrStronglyAgreeCount, ValidResponseCount)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
Hi @Boopep,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution I have provided for the issue worked? or let us know if you need any further assistance.
If my response addressed, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi @Boopep,
We wanted to kindly follow up to check if the solution I have provided for the issue worked.
If my response addressed, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi @Boopep,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution I have provided for the issue worked.
If my response addressed, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
You should be able to unpivot the data in power query, go to transform data, choose to unpivot and then just use sum over the column.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
39 | |
35 |
User | Count |
---|---|
107 | |
56 | |
52 | |
48 | |
40 |