Forum Discussion

dkrishnan's avatar
dkrishnan
Frequent Visitor
6 years ago
Solved

Power Bi Dynamic Slicer

HI

 

I have a table with as per below:

DATE_CODEPARTNERREVENUE_TYPEHUBPRODUCTCOMPONENT_DIRECTIONCALL_COUNTDURATIONAMOUNT
01-03-2020AMOBILEEURAAAB200040000500
01-03-2020BFIXEDASIABBAB100030000200

 

Now i want to create a chart that dynamically change to either show CALL_COUNT or DURATION or AMOUNT. Whenever i tried using selectedvalues, it is not enabling me to choose either CALL_COUNT, DURATION or AMOUNT. They are not measured column rather is data value. How do i achieve this using a dynamic slicer or any other option?

 

Appreciate any help

 

regards

deven

  • Anonymous's avatar
    Anonymous
    6 years ago

    HI dkrishnan,

    You can create a new table with all measure field names and use this table field on a slicer.
    After these steps, you can write a measure formula to compare current slicer seleciton and use with switch function to redirect current value to specific measure formula results.

    Calculate table:

    Selector= {"Measure1","Measure2","Measure3"}

    Measure:

    Measure =
    SWITCH (
        SELECTEDVALUE ( Selector[Value] ),
        "Measure1", [Measure1],
        "Measure2", [Measure2],
        "Measure3", [Measure3],
        Sum(Table[Amount])
    )
    
    

    Regards,

    Xiaoxin SHeng

3 Replies