Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Dimension slicer

Hello Community   -   I have a salesperson dim table and am using the "salesperson" field to filter a report page that has sales data on it from our shipping table.  The salesperson field is on that table and I have the two fields connected in my data model. 

 

The strange thing is, that if use this measure below, the dimension slicer gets totally ignored....it will not filter the salesperson.   If I just used the measure in the VAR by itself...it does.   

 

Any idea what it is about this formula below that is causing it to be ignored by my dimension slicer? 

 

Total Sales =
var _totalsales = SUM(Shipments[ShippedPrice])

return
IF(ISBLANK(_totalsales),0,_totalsales)
  • Anonymous not sure what is not working, can you share the screenshots explaining what is ignore and what is expected?

     

    You can also do this:

     

    Total Sales =
    var _totalsales = SUM(Shipments[ShippedPrice])
    
    return
    _totalsales + 0

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

2 Replies

  • Anonymous not sure what is not working, can you share the screenshots explaining what is ignore and what is expected?

     

    You can also do this:

     

    Total Sales =
    var _totalsales = SUM(Shipments[ShippedPrice])
    
    return
    _totalsales + 0

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • v-yingjl's avatar
    v-yingjl
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Not certain, basically it should work. Besides the measure like @ parry2k mentioned, you can also create measure like this:

    Total Sales = 
    IF(
        SUM('Table'[ShippedPrice])= 0,0,SUM('Table'[ShippedPrice]) 
    )

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.