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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

how do i Count if

Brand new to PowerBI. Lots of excel experience... I'm sure this question gets asked all the time.

Trying to create a new table calculated from a flat table. Flat table is named "SMT_Export".  New table is named "Sites_by_tech"

I have the first column pulling the Regions from flat table as follows:  =DISTINCT(SMT_Export[Region]).  generates a column with 4 values (north, south, east, west)

I need column 2 to be a count value for the following conditions:

SMT_Export[Region] = Sites_by_tech[Region]
SMT_Export[Site Status]= "ON-AIR"
SMT_Export[NR]= TRUE

 

Help please.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

fantastic! i had to correct formatting on the true/false column, but appears to be working.  If i want to add additional columns with similar calculations, do i add to the above ADDCOLUMNS:

"Count2",
		CALCULATE(
			COUNTROWS(SMT_Export),
			SMT_Export[LTE] = True,
			SMT_Export[Site Status] = "ON-AIR"
		)

 ETC?

View solution in original post

Hi,  @Anonymous 

 

If you have already created a new table and want to add a new column, you can directly add calculated column.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

fantastic! i had to correct formatting on the true/false column, but appears to be working.  If i want to add additional columns with similar calculations, do i add to the above ADDCOLUMNS:

"Count2",
		CALCULATE(
			COUNTROWS(SMT_Export),
			SMT_Export[LTE] = True,
			SMT_Export[Site Status] = "ON-AIR"
		)

 ETC?

Hi,  @Anonymous 

 

If you have already created a new table and want to add a new column, you can directly add calculated column.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@Anonymous 

Creat your table as follows:

Sites_by_tech = 
ADDCOLUMNS(
	VALUES(SMT_Export[Region]),
	"Count",
		CALCULATE(
			COUNTROWS(SMT_Export),
			SMT_Export[NR] = True,
			SMT_Export[Site Status] = "ON-AIR"
		)
)

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors