Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PowerBI – Get 2 tables from 1 table and subtract them

i have the following data.

Group   Modell  Place COUNT
5         A      T1   1
5         A      T2   1
5         B      T1   1
5         B      T2   2
5         B      T3   2

I want to give the user in PowerBi two different slicers where he can choose the Models he want to compare.

Slicer1 = A
Slicer2 = B

What i now need are the following tables.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Table1

Group   Modell1  Modell2    Place COUNT
5         A         B        T1    0
5         A         B        T2   -1
5         A         B        T3   -2

Table2

Group   Modell1  Modell2    COUNT
5         A         B       -3

Hope someone can help. I tried it with parameters, but i am not able to subtract them.

>Solution :

You can try this

  1. create two tables

    Slicer = DISTINCT(‘Table'[Model])

    Slicer2 = DISTINCT(‘Table'[Model])

  2. create measures

    Model1 = SELECTEDVALUE(Slicer[Model])

    Model2 = SELECTEDVALUE(Slicer2[Model])

     MEASURE =
     CALCULATE (
         SUM ( 'Table'[COUNT] ),
         'Table'[Model] = SELECTEDVALUE ( Slicer[Model] )
     )
         - CALCULATE (
             SUM ( 'Table'[COUNT] ),
             'Table'[Model] = SELECTEDVALUE ( Slicer2[Model] )
         )
    

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading