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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Need count across multiple columns with the same data peppered in a table

I have 3 columns (A1, A2, A3) each containing the same data peppered throughout the 3 columns. I also have 1 column (TAG No) that all 3 columns relate to. I am new to PowerBI and I am trying to be able to display a count of data that is the same across the 3 columns (A1, A2, A3).

 

I also have several slicers that drill down the entire data set such as all tags that are issued (Issued = I%) and are smaller than 2". From my filter, the display set shows the available data based on the filter. What I would like to be able to do is count all the GUA items that are contained in the 3 columns and display the result. Using GUA to quantify, my result should be GUA=5 (based on the table below). 

 

TAG NoA1A2A3

0001

AABGUA 
0002GUA  
0003CCBAABGUA
0004004  
0005GUACCB 
0006AABGUA 

 

Does anyone have a suggestion as to how to go about creating this?

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

Something like this should work for you.

 

GUA = 
VAR _String = "GUA"
RETURN
    CALCULATE ( 
        COUNTROWS ( YourTable ), 
        YourTable[A1] = _String || YourTable[A2] = _String || YourTable[A3] = _String
    )

jdbuchanan71_0-1668641403422.png

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Anonymous 

Something like this should work for you.

 

GUA = 
VAR _String = "GUA"
RETURN
    CALCULATE ( 
        COUNTROWS ( YourTable ), 
        YourTable[A1] = _String || YourTable[A2] = _String || YourTable[A3] = _String
    )

jdbuchanan71_0-1668641403422.png

 

 

Greg_Deckler
Super User
Super User

@Anonymous Unpivoting your columns in Power Query might be a good choice here. Otherwise, you can use MC Aggregations: Multi-Column Aggregations (MC Aggregations) - Microsoft Power BI Community


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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