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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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