Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I have this column in powerbi:
DiscussionEvents
1. Discussion Created
2. Discussion Reply Created
3. Discussion Updated
4. Discussion Viewed
I am trying to create a flag measure that returns me 1 if the count of "Discussion Created" and "Discussion Reply Created" is not zero and vice versa.
Could anyone help please.
Solved! Go to Solution.
Hi @sonaliverma ,
Please try the following formula:
Measure =
VAR count_created =
CALCULATE (
COUNT ( 'Table'[DiscussionEvents] ),
'Table'[DiscussionEvents] = "Discussion Created"
)
VAR count_reply =
CALCULATE (
COUNT ( 'Table'[DiscussionEvents] ),
'Table'[DiscussionEvents] = "Discussion Reply Created"
)
VAR flag =
IF ( count_created > 0 && count_reply > 0, "YES", "NO" )
RETURN
IF (
ISFILTERED ( 'Table'[DiscussionEvents] ),
COUNT ( 'Table'[DiscussionEvents] ),
flag
)
Then modify the total label: "Flag".
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @nvprasad ,
Thank you for your response. Actually I am trying to build a Matrix with below columns:
DiscussionEvents
1. Discussion Created
2. Discussion Reply Created
3. Discussion Updated
4. Discussion Viewed
DiscussionID
1. 4256
2. 5619
3. 8916
etc. etc.
I am trying to create a pivot table like this:
DiscussionID Discussion Created Discussion Replied Flag
1234 1 NO
4567 2 1 YES
5678 6 4 YES
5691 1 NO
POV: Values in discussion created and discussion replied is the count(DiscussionEvents).
Hi @sonaliverma ,
Please try the following formula:
Measure =
VAR count_created =
CALCULATE (
COUNT ( 'Table'[DiscussionEvents] ),
'Table'[DiscussionEvents] = "Discussion Created"
)
VAR count_reply =
CALCULATE (
COUNT ( 'Table'[DiscussionEvents] ),
'Table'[DiscussionEvents] = "Discussion Reply Created"
)
VAR flag =
IF ( count_created > 0 && count_reply > 0, "YES", "NO" )
RETURN
IF (
ISFILTERED ( 'Table'[DiscussionEvents] ),
COUNT ( 'Table'[DiscussionEvents] ),
flag
)
Then modify the total label: "Flag".
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi sonaliverma,
Can you try below measure.
Check = if (CALCULATE(COUNTROWS(TABLE),TABLE[COLUMN]="Discussion Created" ||TABLE[COLUMN]="Discussion Reply Created")>0, "YES","NO")
Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂
Regards,
N V Durga Prasad
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
117 | |
84 | |
49 | |
38 | |
28 |
User | Count |
---|---|
188 | |
76 | |
73 | |
54 | |
42 |