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
Anonymous
Not applicable

Calculating Value based on Filters in Dax

Hi There,

 

I am trying to create a measure where i am counting number of rows anf filtering the table with a column.

However as soon as i am doing it i am encountering error WHICH Is mentioned below:

 

ashicool_10061_0-1727193847714.png

Measure=calculate(countrows(iterm code),filter(table,Process name))

ashicool_10061_1-1727194249516.png

 


Can you please help me in achieving the same result?

 

Thanks,

ashish

 

@SamWiseOwl 

1 ACCEPTED SOLUTION

@Anonymous 

 If you're trying to count the number of process names, for example, if your table has five rows with 'ABC', you can simply count the process names, which would give you a total of 5. You can do this using count(Table[processname]) or count(table[itemcode])

Apologies if I misunderstood, but could you clarify what you're referring to?

marcelsmaglhaes_1-1727300329457.png

 

marcelsmaglhaes_0-1727300313288.png

 


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @marcelsmaglhaes ,

 

It worked the way you told. Appreicate your help.

 

Thanks,

Ashish

marcelsmaglhaes
Super User
Super User

Hey @Anonymous ,

The issue you're encountering is because you're trying to use a column in the filter that isn’t a Boolean expression. In your case, you're attempting to filter the table using just the column name (Process name), which is causing the error. You can fix the measure by ensuring the filter condition is properly defined:

Measure =
CALCULATE(
COUNTROWS('item code'),
FILTER('table', 'table'[Process name] = "Some Value") -- Replace "Some Value" with the actual value you want to filter on
)

However, based on your example, I believe you might be able to simplify the measure like this:

Measure = COUNT('table'[Process name])


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



Anonymous
Not applicable

Hi @marcelsmaglhaes ,

 

I have tried themeasure wheere you have mentioned to replace "Some value" with the value which i want
Measure =
CALCULATE(
COUNTROWS('item code'),
FILTER('table', 'table'[Process name] = "Some Value") -- Replace "Some Value" with the actual value you want to filter on
)

however if i will do this then it will be for particular process name however i need a dynamic or count of each process name present in that table .

Also if i will do the Count([process_name}) then it will give me the count of all values present there like "5" if i will take process name .

 

I want output as

Process name         Item code
ABC                                 5
BCD                                 3                                 

IS there any way we can do this ?

 

Thanks,

Ashish

@Anonymous 

 If you're trying to count the number of process names, for example, if your table has five rows with 'ABC', you can simply count the process names, which would give you a total of 5. You can do this using count(Table[processname]) or count(table[itemcode])

Apologies if I misunderstood, but could you clarify what you're referring to?

marcelsmaglhaes_1-1727300329457.png

 

marcelsmaglhaes_0-1727300313288.png

 


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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