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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mellas_k
Helper I
Helper I

How to use a multiple filter on the same column

hello ,

I need your help to optimize my work …

I will give you the below table to explain my problem  

Table :

columnA   columnB  column

A               A                    A

A               B                    B

B               B                    C

C               C                    D

 

From this table I need to calculate for each column the count of A , B and C

So I use this measure to calculate the number of “A” on columnA

   measure= (CALCULATE(COUNT(Table [columnA   ]);FILTER(Table; Table[columnA   ]="A")))

Can you please help me if there is any other possibility to regroup filter on the same measure …

 

Best Regards 

1 ACCEPTED SOLUTION

hi @cs_skit

Maybe you don’t understand me but with your example you give me what I need ..

Just I need to add {in}

measure= (CALCULATE(COUNT(Table [columnA   ]);FILTER(Table; Table[columnA ] IN{"A";"B")))

And now I can do many filter on the same column

thanks 🙂

View solution in original post

8 REPLIES 8
cs_skit
Resolver IV
Resolver IV

does this work:

 

CountAinAllCols =
CALCULATE(COUNTROWS(ABCtable);ABCtable[ColumnA]="A") +
CALCULATE(COUNTROWS(ABCtable);ABCtable[ColumnB]="A") +
CALCULATE(COUNTROWS(ABCtable);ABCtable[ColumnC]="A")

hi @cs_skit

Thanks for your answer but I need to calculate each column separately by regrouping the filter

Like this for example  :

measure= (CALCULATE(COUNT(Table [columnA   ]);FILTER(Table; Table[columnA   ]="A"& “B” )))

but it don't work ..

 

thanks

Yeah sorry you need independent of current filter context

 

CountAinAllCols =
COUNTROWS(FILTER(ALL(ABCtable);[ColumnA]="A")) +
COUNTROWS(FILTER(ALL(ABCtable);[ColumnB]="A")) +
COUNTROWS(FILTER(ALL(ABCtable);[ColumnC]="A"))

hi @cs_skit

Thanks for your answer ,but probably you don’t understand my request  .. I need to applicate multiple filter for each column I can use this measure:   measure= (CALCULATE(COUNT(Table [columnA   ]);FILTER(Table; Table[columnA   ]="A")))

it’s work but in my real  table I have 52 column , and for each column I have 3 group of filter ..

So I need to optimize my work ..

thanks

you are right I seem to be too stupid to understand what you want to do

 

maybe this?

 

CountSpecialinAllCols =

COUNTROWS(FILTER(ALL(ABCtable);[ColumnA] IN{"A";"B"})) +
COUNTROWS(FILTER(ALL(ABCtable);[ColumnB] IN{"A";"B";"XYZ"})) +
COUNTROWS(FILTER(ALL(ABCtable);[ColumnC] IN{"B";"C";"uniquestuff"}))

hi @cs_skit

Maybe you don’t understand me but with your example you give me what I need ..

Just I need to add {in}

measure= (CALCULATE(COUNT(Table [columnA   ]);FILTER(Table; Table[columnA ] IN{"A";"B")))

And now I can do many filter on the same column

thanks 🙂

Anonymous
Not applicable

Worked, but please write the code correctly 

 

Measure = CALCULATE(COUNT(CoulmnName), FILTER(Table, ColumnName IN {"A","B","C"}))

glad to be of help 🙂

 

also SWITCH statement can be nice for filters

https://www.youtube.com/watch?v=-ykkaAtlCMc

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.