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

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

Reply
nataliesmiy1357
Helper IV
Helper IV

Custom if statement

Hello!  I am trying to write a switch statement (or an if statement), but it's not working correctly.  

 

I want to create an equation/statement that takes the number for the minimum no of tms (the value) and if the count of employees with a score (in the colors) greater than 3 is the minimum no of tms or greater, then yes, but if not, no.  (something like: if (count(employee name) with score >= 3 is greaterthan or equal to minumum number of tms, yes, no)

 

But I'm not sure how to write that in DAX.  Would it be a double if statement? Thanks in advance

9 REPLIES 9
TomMartens
Super User
Super User

Hey @nataliesmiy1357 , 

 

please create a pbix file that contains sample data, but still reflects your data model (tables, relationships, calculated columns, measures), of course only the objects are important that circle around the challenge you are facing. Upload the pbix file to onedrive or dropbox and share the link. If you are using Excel to create the sample data instead of the manual input method, share the Excel file as well.

 

Describe the expected result based on the sample data you provide.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Tom - here is the link to my pbix file.  

https://app.powerbi.com/links/i83KvT1JCr?ctid=8c642d1d-d709-47b0-ab10-080af10798fb&pbi_source=linkSh...

 

This is the idea I'm thinking: (something like: if (count(employee name) with score >= 3 is greaterthan or equal to minumum number of tms, yes, no)

Also, here is a screenshot of what it should be (the yes's and no's)

nataliesmiy1357_0-1638563960311.png

 

Hey @nataliesmiy1357 ,

 

the link you provided is not the link to pbix file, but instead it points to the report in your power bi tenant. As I'm not a member of your tenant, I can't access the report.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

No, I can't access your tenant.



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

It looks like my company won't share..... so let's try another way.... how can I create an if statement with two things, then...

 

if (a and b) then ___

Hey @nataliesmiy1357 ,

 

using Power Query (M) here is a M snippet

if [Dim1] = "A" and [Dim2] = "B" then "this" else "that"

and the same using DAX to create a calculated column

if ( ( 'Table'[Dim1] = "A" && 'Table'[Dim2] = "B" ), "this" , "that" )

If this does not help consider creating a pbix using Power BI Desktop and uploading the file to your private onedrive or dropbox account (this is how most of us share files).

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

That idea works yes - but I'm having trouble putting it into my report.  It unfilters everything when I put that measure into the table.  It's not grouping the data like I wanted....

 

Development Status =
VAR variable1 = SELECTEDVALUE(V_TM_ModulePowerBI[ProficiencyNumber])*3
VAR variable2 = count(V_TM_ModulePowerBI[EmployeeName])*3

return
if(variable1 >= variable2, "YES", "NO")

 

nataliesmiy1357_0-1638812131978.png

nataliesmiy1357_1-1638812162774.png

 

Anonymous
Not applicable

Hi @nataliesmiy1357 ,

 

I think your logic is 

 

 if (count(employee name) with score >= 3 is greaterthan or equal to minumum number of tms, yes, no)

 

I am confused about your countof [EmployeeName] or  current [ProficiencyNumber] will multiply by 3.

I couldn't find V_TM_ModulePowerBI[ProficiencyNumber] and V_TM_ModulePowerBI[EmployeeName] in your screenshot. Please show me a screenshot of your table. This will make it easier for us to understand your requirement.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.