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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
timgiefer
New Member

Count value in column measure

Hi everyone!

 

I'm new to Microsoft Power Bi but there is the thing I want to do:

 

I've got a column called "cutting" with 0 (machine isn't working) and 1 (machine is working).

I want to create a measure called "UT" where the amount of rows with "cutting" = 1 is divided by the total amount of columns in the table 'Tabelle1'. The DAX formula is the following:

 

UT = CALCULATE(COUNT('Tabelle1'[cutting])/COUNTROWS('Tabelle1'); 'Tabelle1'[cutting] = 1)

When I try to display the measure on my dashboard, the field is blank.

 

I have already looked at different forum posts similar to my problem, but nothing seems to work.

 

 

Can anyone help?

 

 

Thanks

 

 

Tim

 

 

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@timgiefer

 

You should specify the context into entire table in your calculation formula. 

 

UT =
CALCULATE (
    COUNT ( 'Tabelle1'[cutting] ),
    FILTER ( ALL ( 'Tabelle1' ), 'Tabelle1'[cutting] = 1 )
)
    / COUNTROWS ( 'Tabelle1' )

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@timgiefer

 

You should specify the context into entire table in your calculation formula. 

 

UT =
CALCULATE (
    COUNT ( 'Tabelle1'[cutting] ),
    FILTER ( ALL ( 'Tabelle1' ), 'Tabelle1'[cutting] = 1 )
)
    / COUNTROWS ( 'Tabelle1' )

Regards,

CahabaData
Memorable Member
Memorable Member

please clarify what is meant by: "...the total amount of columns in table.....

 

how many columns and what are their names - a small sampling of the data set would help

www.CahabaData.com

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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