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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Calculated column conditional count

Hi, I have a table and created this column:

 

mhv22_0-1650987593921.png

 

When I create a visual table It works fine, as it can bee seen:

 

mhv22_1-1650987680498.png

It only shows values ("VIEJO";"NUEVO";"ACTUAL") if stock is >0, if it´s not, blank is showed. 

The problem is when I create this table :

mhv22_2-1650987789946.png

It shows "VIEJO", "NUEVO"; "ACTUAL"...it's not considering the conditions...It's like if one stock is found, it shows the value (VIEJO,NUEVO....) for all the rows...I need the condition line by line...if stock<=0, then "" , if stock >0, then  "VIEJO" for "ULTIMO INGRESO" <01/01/2021, "NUEVO" <01/01/2022, "ACTUAL" for the rest...What am I doing wrong?

 

Thanks in Advance!

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous,

It sounds like you want the calculated column response with filter effects, right?
AFAIK, current power bi does not support it create dynamic calculated column based on filter effect. (they are work on the different data levels and you can't use its child to affect the parent level)
I think you need to create a measure expression which can be interacted with filter effect to instead.

Notice: the data level of power bi.

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@Anonymous , You can create color measure and use that in conditional formatting using field value option

 

example

 

Color Year = if(FIRSTNONBLANK('Table'[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK('Table'[Year],2014)>2018,"red","yellow"))

 

Color = if(FIRSTNONBLANK('Table'[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
,"lightgreen",if(FIRSTNONBLANK('Table'[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")

 

How to do conditional formatting by measure and apply it on pie? : https://youtu.be/RqBb5eBf_I4

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

Thanks @amitchandak , but it´s not what I asked for... I need the same I explained in the post

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.