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
Carter364
New Member

Finding totals from multiple columns

Hi there, I am looking to find common themes across multiple columns. I have changed my data as an example as the data I am using is personal. But in this example I have multiple flags and multiple colums of the colours in the flags.

 

Is there a way I can use an "if" function where if contains 'red' across any of the colour columns then 'Yes', if not then 'No' ?

 

Any help would be much appreciated.

Screen Shot 2024-04-17 at 2.35.23 PM.png

1 ACCEPTED SOLUTION

you can unpivot tables in the PQ

13.PNG12.PNG

 

then create a dim table that you can filter

14.PNG

 

create a measure

 

Measure = DISTINCTCOUNT('Table'[Flag])
15.PNG
 
pls see the attachment below

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

do you mean if there is a red in the colour 1 column then Yes? 

what's the expected output based on the sample data you provided?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It's hard to explain because the actual data I am using is quite specific. But ultimatley It would say if red is in colour 1, colour 2, colour 3, or colour 4 then "Yes"

 

I would do this for various colours, then I would be able to determine how many flags contain red, how many flags contain blue etc.

 

The data I am using contains 3000+ rows of data

you can unpivot tables in the PQ

13.PNG12.PNG

 

then create a dim table that you can filter

14.PNG

 

create a measure

 

Measure = DISTINCTCOUNT('Table'[Flag])
15.PNG
 
pls see the attachment below

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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