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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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