The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello Community,
Can someone help me out seems I cannot find the correct DAX command for making a calculated column. I have made the measure but I really need it in a column format.
The Problem: Want to count the total times a value appears in a column per ID.
Table looks like:
ID | Text Values | Count of 'True' Value |
123 | False | 1 |
345 | True | 2 |
567 | Blank | 0 |
123 | True | 1 |
345 | True | 2 |
567 | True | 1 |
789 | False | 0 |
Thank you!
Solved! Go to Solution.
Hi, @MSW
You can try the following methods.
Count of 'True' Value =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( 'Table', [Text Values] = "TRUE" && [ID] = EARLIER ( 'Table'[ID] ) )
)
When the ID is 567, the Count of 'True' Value should also be displayed as 1 because there is already a True value.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @MSW
You can try the following methods.
Count of 'True' Value =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( 'Table', [Text Values] = "TRUE" && [ID] = EARLIER ( 'Table'[ID] ) )
)
When the ID is 567, the Count of 'True' Value should also be displayed as 1 because there is already a True value.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Whitewater100 This worked fantastic thank you. I was trying to put the IF statement after countrows. This helped solve my problem and help me learn better options. Thank you!
Hello- No problem and I understand. Are you able to mark it as a solution? Thanks!
Hi:
When naming your table "Data" we can try this calculated column:
I hope this helped!
User | Count |
---|---|
20 | |
8 | |
7 | |
7 | |
6 |
User | Count |
---|---|
28 | |
12 | |
11 | |
9 | |
8 |