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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
batman
Helper I
Helper I

Field Parameter assistance

Hello,

I need some assistance with field paramters, I created a field parameter called "OTF," which essentially allows toggling between two flags with values of "Yes" and "No." I want to enable users to select either Field A or Field B, and then choose between "Yes" or "No." In this case we are selecting a No in the calculation. 

 

I'm trying to write a calculation as follows:

 

CountRowsNum =
COUNTROWS(
FILTER(
TableName,
TableName[AnotherFlag] = "N" && SELECTEDVALUE('Parameter[OTF]') = "N"
)
)

 

The goal is to count rows where "AnotherFlag" is 'N' and the selected OTF is also 'N,' while allowing users to switch between Field A and Field B.

 

 Thanks 

 

Aj

1 ACCEPTED SOLUTION
Kedar_Pande
Super User
Super User

DAX calculation:

CountRowsNum = 
COUNTROWS(
FILTER(
TableName,
TableName[AnotherFlag] = "N" &&
SWITCH(
TRUE(),
SELECTEDVALUE('Parameter[OTF]') = "Field A", TableName[FieldA] = "N",
SELECTEDVALUE('Parameter[OTF]') = "Field B", TableName[FieldB] = "N",
FALSE()
)
)
)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @batman ,

 

May I ask if you have gotten this issue resolved?
If it is solved, please mark the helpful reply or share your solution and accept it as solution.

If it doesn't resolve, please provide sample data. We can better understand the problem and help you. 

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Dengliang Li

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

Kedar_Pande
Super User
Super User

DAX calculation:

CountRowsNum = 
COUNTROWS(
FILTER(
TableName,
TableName[AnotherFlag] = "N" &&
SWITCH(
TRUE(),
SELECTEDVALUE('Parameter[OTF]') = "Field A", TableName[FieldA] = "N",
SELECTEDVALUE('Parameter[OTF]') = "Field B", TableName[FieldB] = "N",
FALSE()
)
)
)

That seems to work, Thank you 

Helpful resources

Announcements
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!

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.