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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kelsenfaria
New Member

measure with IF and filter context

Here is my model :

 

model.png

 

Using this measure I can filter dProduto related to fPedidoVenda only as we can see from table image.

 

Medida = CALCULATE(SUM(fOP[QT_PENDENTE]) + SUM(fOP[QT_PEND_REPROCESSO]) + SUM(fEstoque[QTD ESTOQUE]) - SUM(fPedidoVenda[QT PENDENTE]))
 

measure without if.png
 
Now I'm trying to use a condition with a IF statement but is not filtering only dProduto related to fPedidoVenda anymore, instead it is showing all dProduto table.
 
IF(CALCULATE(SUM(fOP[QT_PENDENTE]) + SUM(fOP[QT_PEND_REPROCESSO]) + SUM(fEstoque[QTD ESTOQUE]) - SUM(fPedidoVenda[QT PENDENTE])) > 0, "DISPONIVEL", "NAO ESTA DISPONIVEL")
 
measure with IF.png

2 REPLIES 2
kelsenfaria
New Member

Tables images are not correct.

Here is table without IF statement.

measure without if.png

 

And with IF statement :

measure with IF.png

Hi, @kelsenfaria 


After review and research, I am still confusing about your requirement, do you mind  providing a sanitized sample pbix file and  expected output so it will be easier to suggest possible approaches?

 

Best Regards,
Community Support Team _ Eason

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.