Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Slicer not updating Calculated Measure

I have the following measures:

Type1_Value = CALCULATE(SUM('Table'[Number]), 'Table'[Type] = Type1
Type2_Value = CALCULATE(SUM('Table'[Number]), 'Table'[Type] = Type2

Total_Value = Type1_Value + Type2_Value

 

I have a KPI metric that shows Total_Value, and a slicer for both Type1 and Type2.

 

My problem is that when I click either Type on the slicer, the Total_Value doesn't update to show just that Type.

 

How do I fix this?

 

Thanks!

  • Hi, Anonymous 

    According to your description, you want to add a type slicer but now it dos not work. 

    If this , you can try to use keepfilters() fumction , like this:

    Type1_Value = CALCULATE(SUM('Table'[Number]),KEEPFILTERS( 'Table'[Type] = Type1))
    

    For more information, you can refer to :
    KEEPFILTERS function (DAX) - DAX | Microsoft Learn

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

5 Replies

  • Hi, Anonymous 

    According to your description, you want to add a type slicer but now it dos not work. 

    If this , you can try to use keepfilters() fumction , like this:

    Type1_Value = CALCULATE(SUM('Table'[Number]),KEEPFILTERS( 'Table'[Type] = Type1))
    

    For more information, you can refer to :
    KEEPFILTERS function (DAX) - DAX | Microsoft Learn

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Perfect! Worked like a charm! Thank you!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,
    From what I understand from your mistake, I created a demo for you. If you want to get the sum of the values selected with the filter, you can use the ALLSELECTED function. Another reason why the filters you apply does not change your calculation is because the Total_value calculation may be a calculated column.

     

     

    If these are not the solutions to the problem, you can send me the your dashboard screenshots. If my answer was helpful in solving the problem, I'd appreciate it if you could Accept the solution and get more people to view it.

    • Anonymous's avatar
      Anonymous
      Not applicable

      This solution didn't work for me. I've sent you a message with a screenshot.

       

      Thanks for your help!

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    you just need to use

    Total_Value = SUM('Table'[Number])