Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm needing to write a measure that counts the distinct number of "BI_ACCT" that have a "BI_TASK_CD" = 'MW_FBRDROP' and the "BI_WORK_EVENT_CD" of 'COMP' while the task CD for '1STCONTACT' of the same account number equals 'QUEUE'.
I've created a sample file below. In this example I'd only count 1 BI_ACCT (Account# 123) since it's MW-FBRDROP task is COMP and its 1STCONTACT task is QUEUE. I wouldn't count account# 456 since both tasks are completed.
BI_ACCT | BI_TASK_CD | BI_WORK_EVENT_CD |
123 | MW-FBRDROP | COMP |
123 | 1STCONTACT | QUEUE |
456 | MW-FBRDROP | COMP |
456 | 1STCONTACT | COMP |
Any help in this task would be appreciated. I know how to limit just one set of criteria but I'm a bit unsure how to do two sets containing the same columns. Thank you and please let me know if I need to provide any additional details.
Solved! Go to Solution.
@GunnerJ
I created the following measure to count the distinct BI_ACC values based on the criteria, please check and let me know.
BI_Acc_Dcount 2 =
var __t =
CALCULATETABLE(
VALUES(Table2[BI_ACCT]),
Table2[BI_TASK_CD]="MW-FBRDROP",Table2[BI_WORK_EVENT_CD]="COMP"
)
var __result =
CALCULATE(
DISTINCTCOUNT(Table2[BI_ACCT]),
Table2[BI_TASK_CD]="1STCONTACT",Table2[BI_WORK_EVENT_CD]="QUEUE",
__t
)
return
__result
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi, @GunnerJ
Please check the below picture and the sample pbix file's link down below.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@GunnerJ
I created the following measure to count the distinct BI_ACC values based on the criteria, please check and let me know.
BI_Acc_Dcount 2 =
var __t =
CALCULATETABLE(
VALUES(Table2[BI_ACCT]),
Table2[BI_TASK_CD]="MW-FBRDROP",Table2[BI_WORK_EVENT_CD]="COMP"
)
var __result =
CALCULATE(
DISTINCTCOUNT(Table2[BI_ACCT]),
Table2[BI_TASK_CD]="1STCONTACT",Table2[BI_WORK_EVENT_CD]="QUEUE",
__t
)
return
__result
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
97 | |
80 | |
67 | |
63 |
User | Count |
---|---|
147 | |
110 | |
108 | |
85 | |
64 |