Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Comparison between 2 Categories with Dynamic Slicers

Hello,   I am looking for some help with one of the Reports that i am working on.   The report basically compares the values in 1 Table between different Periods. Here Period is in Text formt (Ex...
  • v-zhenbw-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    We can create two slicers based on two new tables and three measures to meet your requirement.

     

    1. Create two new tables just containing the distinct period.

     

    Slicer 1 = DISTINCT('Table'[Period])
    Slicer 2 = DISTINCT('Table'[Period])

     

     

    2. Create three measures and put them to a table visual.

     

    QPA1 = 
    var _selected = SELECTEDVALUE('Slicer 1'[Period 1])
    return
    CALCULATE(SUM('Table'[Qty]),FILTER('Table','Table'[Period]=_selected))

     

    QPA2 = 
    var _selected = SELECTEDVALUE('Slicer 2'[Period 2])
    return
    CALCULATE(SUM('Table'[Qty]),FILTER('Table','Table'[Period]=_selected))

     

    Observation = 
    IF(
        ISBLANK([QPA2]),"PN Deleted",
        IF(
            ISBLANK([QPA1]),"PN added",
            IF(
                [QPA1]<[QPA2],"QPA Increased","QPA Decreased")))

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

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