Forum Discussion

izzysoon's avatar
izzysoon
Helper I
4 months ago
Solved

Dynamic Ratio creator

Hello all,  I am new to community.  Please kindly help!  I would like to select the "Field" in slicer and create a ratio.   Not sure I need to duplicate the "Field" to have two different slicers as ...
  • izzysoon's avatar
    izzysoon
    4 months ago

    Is this ok ?  

     

    DateFieldvalue
    Jan-23A45
    Jan-23B46
    Jan-23C47
    Jan-23D140
    Jan-23E10
    Feb-23A49
    Feb-23B11
    Feb-23C23
    Feb-23D41
    Feb-23E39
    Mar-23A40
    Mar-23B55
    Mar-23C39
    Mar-23D45
    Mar-23E105

     

    Example 2   
    from SlicerJan-23Feb-23Mar-23
    E1039105
    A454940
    Ratio (E/A)0.22220.79592.6250

     

    from SlicerJan-23Feb-23Mar-23
    A454940
    C472339
    Ratio (A/C)0.95742.13041.0256
  • mickey64's avatar
    4 months ago

    For your reference.

     

    Step 0: I use these DATA below.

     

    Step 1: I make two tables and four measures below.

     <Tables>

        Field01 = SUMMARIZE('DATA','DATA'[Field])
        Field02 = SUMMARIZE('DATA','DATA'[Field])
     
    <Measures>
    Field01_Sel = SELECTEDVALUE(Field01[Field])
    Field02_Sel = SELECTEDVALUE(Field02[Field])
    value Sel = SUMX(FILTER('DATA','DATA'[Field]=[Field01_Sel]),'DATA'[value])+SUMX(FILTER('DATA','DATA'[Field]=[Field02_Sel]),'DATA'[value])
    Ratio = DIVIDE(SUMX(FILTER('DATA','DATA'[Field]=[Field01_Sel]),'DATA'[value]),SUMX(FILTER('DATA','DATA'[Field]=[Field02_Sel]),'DATA'[value]))
     
    Step 2: I make two slicers and a matrix below.
    <Ratio=A/C>

     <Ratio=E/A>

     

  • mickey64's avatar
    mickey64
    3 months ago

    I don't know how to move the Ratio under the value Sel.

    It is easy making a line chart.