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
harry6810
Frequent Visitor

Calculate Measure with IF Statement

Hi,

I'd like to create a measure that counts all the occurrences of "1" in a table (column "Status"). This will be used to visualize the data in a chart.

Current Measures:

- eLen price = CALCULATE(Min('CEN'[Price]),CEN[Reseller]="eLen ")
- Min price = MIN(CEN[Price])
- Status = IF([eLen price] = [Min price],1,0)

 

harry6810_0-1718884108091.png

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@harry6810 , Try using below measure

 

Count of Ones =
COUNTROWS(
FILTER(
'YourTableName',
'YourTableName'[Status] = 1
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@harry6810 , Try using below measure

 

Count of Ones =
COUNTROWS(
FILTER(
'YourTableName',
'YourTableName'[Status] = 1
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.