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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Help on if condition

Hi, 

 

I'm having a strange problem on this column formula. I have to put a flag based on 2 conditions. I wrote this formula:

Flag Presenza = if(sum(Variabili[Ore Assenza])>12 && sum(Variabili[Ore Assenza])=6,0,
if(sum(Variabili[Ore Assenza])>8 && sum(Variabili[Ore Contratto])=4,0,1)
)
I don't get why in the first row, even though I have 18 as Ore Assenza, the formule doesn't work and still gives 1 as an output, which means it doesn't recognize the case correctly.
Thank you

filippodea_0-1657786460288.png

 

1 ACCEPTED SOLUTION
technolog
Super User
Super User

Hi @Anonymous ! Why are you using SUM in formula?

Could you try:

Flag Presenza = if(Variabili[Ore Assenza]>12 && Variabili[Ore Assenza]=6,0,
if(Variabili[Ore Assenza]>8 && Variabili[Ore Contratto]=4,0,1)
)

View solution in original post

2 REPLIES 2
technolog
Super User
Super User

Hi @Anonymous ! Why are you using SUM in formula?

Could you try:

Flag Presenza = if(Variabili[Ore Assenza]>12 && Variabili[Ore Assenza]=6,0,
if(Variabili[Ore Assenza]>8 && Variabili[Ore Contratto]=4,0,1)
)
Anonymous
Not applicable

Hi technolog,

The issue was exactly what you mentioned. I used incorrectly the sum formula so it was not calculating row by row, but in a table context. 

Thank you for the immediate answer

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.