Forum Discussion

unclejemima's avatar
unclejemima
Post Patron
2 years ago

Report level filter not working on a calculation

I have a report that calculates how much product we have on order of a given product.  To get the results, I have a "SUM" calculation from a different table.

 

I have a calculation that looks like this....

Qty-PO_P&A = calculate(sum('Stok'[QTY-OnSentPO])+calculate(SUM(('Stok'[QTY-OnPendingPO]))))
 
You can see it's getting the calcuation from the table STOK, but this calculation resides in a table called INVENTRY
 
I applied a report level filter to exlude a certain supplier from the report...but it won't change the results of the calculation and I can't seem to figure out why?

Is this normal function, in that a calculation results can not be manipulated by a report level filter?  If so, is there a work around to apply a filter to the calculation?
 
Lets say for example I want to remove SUPPLIER-A from the calculation above.  How would I do that?

Thanks,

11 Replies

  • "@unclejemima does stok table have a relationship with the supplier table?"

     

    parry2k , No it does not.

     

    Though I could create a relationship between the STOK and INVENTRY table.  The Supplier name exisits in both those tables.

     

    Is there a way to modify the original calulation to filter OUT the SUPPLIER-A

     

    This would be an easy solution.

     

     

     

    • unclejemima's avatar
      unclejemima
      Post Patron

      I should also point out, have a LOOKUP formula in the STOK and INVENTRY that pulls the supplier name from the SUPPLIER table.  


      IMy filter shows that it finds 11 records of the SUPPLIER-A from the STOK table...but applying the filter does not change the CALCULATE(SUM results


      I'm assuming again that this is a design of the CALCULATE(SUM and that the results can not be filtered in a report like I normally would?  This is why I'm looking to apply a change to the calculation so it filters the actual calculation from the get go.

  • unclejemima you are trying to perform a calculation based on the model which doesn't support it. First, you need to think outside the Power BI, if you have to perform this calculation manually, how you will do it, and if you are able to solve that then provide the logic. 

    • unclejemima's avatar
      unclejemima
      Post Patron

      Ok.  Thank you parry2k

       

      Can you tell me how to apply a filter to my calculation to remove SUPPLIER-A?  The supplier name exists in the STOK table where the calculation is made so I would assume this is a easy thing to do?

       

      Qty-PO_P&A = calculate(sum('Stok'[QTY-OnSentPO])+calculate(SUM(('Stok'[QTY-OnPendingPO]))))

       

       

  • unclejemima 

    calculate(sum('Stok'[QTY-OnSentPO]), TabeSupplier[Supplier] <> "Supplier A" )
    +
    calculate(SUM('Stok'[QTY-OnPendingPO]), TabeSupplier[Supplier] <> "Supplier A" )
    
  • parry2k  when I asked do you have supplier information in stok table, answer was no,

     

    Sorry, I was confused.  You originally asked does stok table have a relationship with the supplier table?

    You did not ask if if the supplier information was in the stok table.


    I'll try your suggestions and see if I can get it to work.  I apprecaite the help.  I'm not a expert at power BI.  I know just enough to get in trouble 🙂  So thank you for working with me.

  • Can I just get clairification on one thing?  Is it supposed to be possible to filter calculations by report level filters?  Yes or no?

     

    My filter recognizes that there are 11 matches to the supplier I'm trying to filter.  But when I select this filter for the entire report, the calculations do not change on the report.  

     

     

    I'm trying to figure out if this is by function of the software, or because I have something setup incorrectly.

     

  • unclejemima not sure about your question but you cannot use measures as report or page level filter if that is what you are asking.