cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors