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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Ramendra
Helper IV
Helper IV

calculate syntax

Hi  Team,

 

Can some one help me to  know for below syntax in Power BI measure

 

Count column A values if column B contains  value=XYZ and  if  column c contains value= ABC  or  PQR

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@Ramendra 

Just add a NOT to that part:

Measure = CALCULATE(COUNT(Table1[ColA]), Table1[ColB] ="XYZ", NOT Table1[ColC] IN {"ABC", "PCR"} )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

View solution in original post

6 REPLIES 6
v-xuding-msft
Community Support
Community Support

Hi @Ramendra ,

 

Are the answer helpful for you? If yes, please kindly accept as solution. If you still need help, please share some sample data with us. Thanks.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Ramendra , Try like

calculate(count(Table[ColumnA]), filter(Table, Table[column B] ="XYZ" && Table[column B] in {"ABC","PQR"}))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AlB
Community Champion
Community Champion

Hi @Ramendra 

 

Measure =  CALCULATE(COUNT(Table1[ColA]), Table1[ColB] ="XYZ",  Table1[ColC] IN {"ABC", "PCR"} )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Hi @AlB ,

 

Thanks for help.

Can you please also let me  know what  to  mention  instead of  "IN" for  Table1[ColC] IN {"ABC", "PCR"} ) if I want to  apply like below for  same syntax.

 

Table1[ColC] is not equal to "ABC" or  "PCR"

AlB
Community Champion
Community Champion

@Ramendra 

Just add a NOT to that part:

Measure = CALCULATE(COUNT(Table1[ColA]), Table1[ColB] ="XYZ", NOT Table1[ColC] IN {"ABC", "PCR"} )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Hi @AlB ,

Thanks  for help.
Can you please  also let me know what to mention instead of  "IN" if I want to apply like below  for "Table1[ColC] IN {"ABC", "PCR"} )"

 Table1[ColC] does not equal to "ABC" or  "PCR"

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.