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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.