Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to get count of one column based on refrence to other column

Hi Guys,

 

I am trying to get the count of repeat appointments to a particular Task. But I am not able to get the same.

 

See the below table, The task that I have striked through has 2 different appointments but it is being counted as 1. It should be 2. Like same task - 2 appointments.

Is there are way I can get this calculation done in POWERBI ?

Any help on this would be a lot helpful for me to calculate the no appointments taken for each task!

 

Please note I dont want to group the data by copying the Table & grouping it separately .

 

I need to either have a column or a measure created for the same as there are also some tasks where the appointment is Blank. So I need some calculation like

 

IF(Appointment=blank, '0' else count Task where Appointment greater than 1)

 

TaskAppointmentCount
22742571909921
22742621909931
22742661909951
22742671909961
22841871911671
22841921911681
22841921911691
22842121911751
2284231 0
22842381911851
22842511911921
22846171911971

 

Many Thanks,

Prathamesh Sable

4 ACCEPTED SOLUTIONS
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Please create a calculated column using the formula below.

count=IF(Table[Appointment]=blank(),0,CALCULATE(COUNT(Table[Task]),ALLEXCELT(Table,Table[Task])))


If data type of [Task] is Text, please use COUNTA rather than COUNT.

Best Regards,
Angelia

View solution in original post

Anonymous
Not applicable

Hi @Anonymous,

Have you resolved your issue? If you have, please mark the helpful or right reply as answer, so more people will benefit from here.

Best Regards,
Angelia

View solution in original post

Anonymous
Not applicable

Thanks Angelia....

View solution in original post

5 REPLIES 5
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Please create a calculated column using the formula below.

count=IF(Table[Appointment]=blank(),0,CALCULATE(COUNT(Table[Task]),ALLEXCELT(Table,Table[Task])))


If data type of [Task] is Text, please use COUNTA rather than COUNT.

Best Regards,
Angelia

Anonymous
Not applicable

Thanks Angelia

Hi @Anonymous,

Have you resolved your issue? If you have, please mark the helpful or right reply as answer, so more people will benefit from here.

Best Regards,
Angelia

Anonymous
Not applicable

Thanks Angelia....

Anonymous
Not applicable

Thank you so much for getting this resolved.

 

It helped a lot.

 

Regards,

Prathamesh Sable

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.