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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.