Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a table set-up like:
ID
Candidate ID
Type (Application or Contract)
Source (Ex. Google, web, referral)
I need to count the Total Applications (distinct ID) by Source. But, if a Candidate ID has an Application and a Contract, I will use the Source on the Contract, but if there is only an Application I will use the Source on the Application. Unsure how to accomplish this?
Solved! Go to Solution.
Hi @aashton ,
Here are the steps you can follow:
1. Create calculated column.
Count =
var _column=SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])),"Type1",[Type])
return
IF(
"Application" in _column&&"Contract" in _column,
COUNTX(
FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])&&'Table'[Type]="Contract"),[Source]),
COUNTX( FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])&&'Table'[Type]=EARLIER('Table'[Type])),[Source]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @aashton ,
Here are the steps you can follow:
1. Create calculated column.
Count =
var _column=SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])),"Type1",[Type])
return
IF(
"Application" in _column&&"Contract" in _column,
COUNTX(
FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])&&'Table'[Type]="Contract"),[Source]),
COUNTX( FILTER(ALL('Table'),'Table'[ID]=EARLIER('Table'[ID])&&'Table'[Type]=EARLIER('Table'[Type])),[Source]))
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
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 |
---|---|
81 | |
79 | |
58 | |
35 | |
34 |
User | Count |
---|---|
99 | |
59 | |
56 | |
46 | |
40 |