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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
acg
Resolver I
Resolver I

Creating a new Table based on conditions

I need to create a new table in power BI to write down the follwing (sql)condition:

WITH CTE_1 AS (
--Yes/No Logic applied
SELECT *
FROM [IDW_mart_DEV].[dbo].[v_q]
WHERE
([Question Code] = 'CFOFRQ0036' 
OR [Question Code] ='CFOFRQ0037')
AND [Answer Boolean Value] IN ('Yes' , 'No')
)

What I have done so far is:

Yes/No Logic =
CALCULATETABLE('Fact QNA','Dim Questions'[Question Code]= "CFOFRQ0036" , 'Dim Questions'[Question Code]= "CFOFRQ0037" ,'Fact QNA'[Answer Boolean Value]= "Yes" && "No")

 

 

How do I implement the ( OR)  AND 

condition. 

I tried it, but dod not work. 

Any ideas are much appreaciated. 

1 ACCEPTED SOLUTION
MahyarTF
Memorable Member
Memorable Member

Hi,

Use in {} in your Code :

Yes/No Logic =
CALCULATETABLE('Fact QNA','Dim Questions'[Question Code] in {"CFOFRQ0036" , "CFOFRQ0037"} ,'Fact QNA'[Answer Boolean Value] in {"Yes", "No"})
Thanks for Kudos,
and please select it as a solution if helps
Mahyartf

View solution in original post

2 REPLIES 2
acg
Resolver I
Resolver I

wonderful, thank you for the learning opportunity!

MahyarTF
Memorable Member
Memorable Member

Hi,

Use in {} in your Code :

Yes/No Logic =
CALCULATETABLE('Fact QNA','Dim Questions'[Question Code] in {"CFOFRQ0036" , "CFOFRQ0037"} ,'Fact QNA'[Answer Boolean Value] in {"Yes", "No"})
Thanks for Kudos,
and please select it as a solution if helps
Mahyartf

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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