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

Using calculate with IF

i want to get distinct count of student_id with a condition that if it id is there then it should display Yes and if no enrollemnt id then NO.

 
Issue is im not able to call that variable in measure formula or pwoer bi is not detecting it
Let me know where im wrong
 
 
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Not sure what you want to do with yes or No. try like

fn1 = CALCULATE(DISTINCTCOUNT(student [Employeeid]),not(isblank(student[Enrolemntid])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Your description doesn't sound right.

How can you display YES or NO for a count value?

Do you mean display distinct count value of Student ID if Enrollemtnt Id is not blank?

Please elaborate your query by sharing some sample data screenshots with the desired output.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.