Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Using 2 measures from duplicate tables in the same table for comparison

Hi Everyone

 

I have 2 slicers. Both on the same 'score' field. I duplicated my scores table so each slicer impacts one.

 

ScoreValue
1a
2b
3c

4

d
5e

 

I have 2 slicers, lets say one slices the score between 1-2 and the other slicing between 3-5.

 

I create a CountA measure to count how many times each value appears in the score range above.

 

ValueWordcount1 (slicer one)Wordcount2 (slicer 2)
a  
b  
c  
d  
e  

 

I want to be able to compare the word counts based on 2 different slicers, so I need them in a table with a new column to show difference (delta)

 

The problem arises when I put both counts on the same table,does not work because of the filter context.

 

When the measures are in separate tables. It works fine. I just need wordcount2 to count from the relevant table without interference from values and wordcount1

 

 

  • Hi Anonymous,

     

    Create 2 slicer tables as below:

    slicer table1 = VALUES('Table'[Score])
    slicer table2 = VALUES('Table'[Score])

    Then create 2 measures as below:

    Measure based on slicer 1 = CALCULATE(COUNT('Table'[Value]),'Table'[Score] in FILTERS('slicer table1'[Score]))
    Measure based on slicer 2 = CALCULATE(COUNT('Table'[Value]),'Table'[Score] in FILTERS('slicer table2'[Score]))

    And you will see:

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!

1 Reply

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi Anonymous,

     

    Create 2 slicer tables as below:

    slicer table1 = VALUES('Table'[Score])
    slicer table2 = VALUES('Table'[Score])

    Then create 2 measures as below:

    Measure based on slicer 1 = CALCULATE(COUNT('Table'[Value]),'Table'[Score] in FILTERS('slicer table1'[Score]))
    Measure based on slicer 2 = CALCULATE(COUNT('Table'[Value]),'Table'[Score] in FILTERS('slicer table2'[Score]))

    And you will see:

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!