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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors