Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dynamic Calculated Value Based on Two Slicers

What I have:

 

PROJECTWORKERS
AAlan
A

Bary

ACoen
ADani
AEarl
BFord
BGail
BHerb
CIago
CJohn

 

What I need:

---

Making a "Project Comparison Tool"

 

Left side a dynamic Project chosen by Slicer A... Right side a dynamic Project chosen by Slicer B

 

Already got this to work...

But now I need a calculated card with a dynamic measure based on the values of the other cards.

(in the example, 4/5)

 

PowerBI doens't seems to be object oriented as other microsoft applications... so I can't just get "card01.value"

 

Already tried to use SELECTEDVALUE as a filter but it doesn't work...

 

any ideas?

 

  • Hi Anonymous ,

    According to your description, I'm afraid it can't be achieved in a single table, as Power BI can't distinguash the same column in two seperate slicers. Here's my solution.

    1.In Power Query, right-click the table and select Duplicate to create a duplicate table. The two tables should have not relationship in data model.

    2.Create a measure.

    Measure =
    DIVIDE ( COUNT ( 'Table (2)'[WORKERS] ), COUNT ( 'Table'[WORKERS] ) )
    

    3.Then put PROJECT columns from the two tables to seperate slicers, put WORKERS columns from two tables to seperate card visuals and select Count in the fileds pane, then put the measure in a card visual, get the result.

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

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

     

2 Replies

  • Hi Anonymous ,

    According to your description, I'm afraid it can't be achieved in a single table, as Power BI can't distinguash the same column in two seperate slicers. Here's my solution.

    1.In Power Query, right-click the table and select Duplicate to create a duplicate table. The two tables should have not relationship in data model.

    2.Create a measure.

    Measure =
    DIVIDE ( COUNT ( 'Table (2)'[WORKERS] ), COUNT ( 'Table'[WORKERS] ) )
    

    3.Then put PROJECT columns from the two tables to seperate slicers, put WORKERS columns from two tables to seperate card visuals and select Count in the fileds pane, then put the measure in a card visual, get the result.

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    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

      Hi v-yanjiang-msft 

       

      Although this solution works, my IRL problem I have to do this division with several tables and they're quite large. I don't know if duplicating all the tables will result in a file with double the size and half the 'speed'.

       

      Thanks anyways ğŸ˜‰