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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.