Forum Discussion

bytheway's avatar
bytheway
Regular Visitor
9 years ago

Dynamic Measure based on selected filters/slicers

This feels like an incredibly simple problem, but I'm an incredibly simple person.

 

I'm doing a revenue chart with one line for each year. I have a measure which compares the YoY growth ebtween years. The measure behaves when I have no slicers engaged but falls apart the second I select something in the slicer. So my question is: how do you have the measure respond to the selected slicers? I can see what the overall growth is for the whole business, but when I've got a slicer on WORKER A, I want the measure to just return the overall growth for WORKER A. The measure will be used as a tooltip on a linegraph.

 

Thanks for your help!

17 Replies

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

    can you post the dax code here?  

     

    when you say fall apart, what happens exactly

    • bytheway's avatar
      bytheway
      Regular Visitor

      Sum of last year:

      LY All Rev = SUM('LY Performance'[Revenue])

       

      Sum of this year:

      TY All Rev = SUM(Performance[Revenue])

       

      YoY Growth:

      YoY Growth All Rev = ([TY All Rev]/[LY All Rev])-1

       

      When used as a tooltip it displays the correct % value week to week, but when any slicers are engaged the % value drops dramatically which suggests it's comparing the smaller filtered value to the grand total for the previous year. They don't tally with the quoted Revenue figures used in the calculation

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

        firstly i would do a divide in dax as 

        YoY Growth All Rev =  divide([TY All Rev],[LY All Rev])

         

        (not sure it will make a diff but worth a try)

        what is the -1 for?