Forum Discussion

Artemis1254's avatar
Artemis1254
Frequent Visitor
8 years ago
Solved

Getting Difference of Data derived from the same table

Hi,   In Dynamic Query Mode, I have two tables that computer the median latency of certain jobs from the same table. They both have their own slicers so I can filter the two tables for the data I a...
  • Artemis1254's avatar
    8 years ago

    Per OwenAuger:

     

    "Hi Artemis,

     

    Sure, there are ways to do this.

     

    Just checking your current setup: Is it correct that you just have one underlying table of data in the data model, and you have created two separate table visuals which are filtered by separate slicers which do not interact?

     

    If that's the case, then we should actually change things. The options I can think of are:

    1. Create a 2nd copy of your data table, and create copies of the measures for that table. You would eventually end up with measures [Sum of Median Latency 1] and [Sum of Median Latency 2].
      Then you can have Difference = [Sum of Median Latency 1] - [Sum of Median Latency 2]
    2. Create a set of secondary lookup tables for any slicers you want to use, with inactive relationships to the corresponding columns in your main table. Then write a set of secondary measures that look like = CALCULATE ( [Original Measure], ALL ( <filter column 1> ), USERELATIONSHIP( <filter column 1>, <secondary filter column 1>,...)
      This method is a bit more complicated.

     

    Any chance you can post a link to a sanitised model - then I could build a quick example?

     

    Regards,

    Owen"

     

    I went ahead with the first solution and it works!