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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors