Forum Discussion

AlessandroBet's avatar
3 years ago
Solved

Filter by slider

Hi,

 

i have this formula:

 

#Billing = CALCULATE(
            SUM('Forecast (Billing)'[Billing]),'Forecast (Billing)'[Opportunity Status]="Won")+        
            CALCULATE(
              SUM('Forecast (Billing)'[Billing]),'Forecast (Billing)'[Opportunity Status]="Open",'Forecast (Billing)'[Product]="Product X")
 
and i would like replacing the strings "Won" and "Open" with a slider like this
 
  Could you help me?
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  AlessandroBet ,

     

    Here are the steps you can follow:

    1. Enter data – Create a table.

    2. Create measure.

    Flag =
    var _select=SELECTCOLUMNS('Slicer_Table',"Opportunity",'Slicer_Table'[Opportunity Status])
    var _count=COUNTX(ALLSELECTED('Slicer_Table'),[Opportunity Status])
    return
    SWITCH(
        TRUE(),
      "Open" in _select&&NOT("Won") in _select && MAX('Forecast (Billing)'[Opportunity Status]) in _select&& MAX('Forecast (Billing)'[Product])="Product X",1,
      "Won" in _select&&NOT("Open") in _select && MAX('Forecast (Billing)'[Opportunity Status]) in _select ,1,
      _count =2 &&
      OR(
      MAX('Forecast (Billing)'[Opportunity Status]) =MAXX(FILTER(ALL(Slicer_Table),'Slicer_Table'[Index]=MINX(ALL(Slicer_Table),[Index])),[Opportunity Status]) ,
      AND(
          MAX('Forecast (Billing)'[Opportunity Status])= MINX(FILTER(ALL(Slicer_Table),'Slicer_Table'[Index]=MAXX(ALL(Slicer_Table),[Index])),[Opportunity Status]),MAX('Forecast (Billing)'[Product])="Product X")),1,0)
    #Billing =
    SUMX(
        ALLSELECTED('Forecast (Billing)'),[Billing])

    3. Place [Flag]in Filters, set is=1, apply filter.

    4. Result:

     

    Best Regards,

    Liu Yang

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  AlessandroBet ,

     

    Here are the steps you can follow:

    1. Enter data – Create a table.

    2. Create measure.

    Flag =
    var _select=SELECTCOLUMNS('Slicer_Table',"Opportunity",'Slicer_Table'[Opportunity Status])
    var _count=COUNTX(ALLSELECTED('Slicer_Table'),[Opportunity Status])
    return
    SWITCH(
        TRUE(),
      "Open" in _select&&NOT("Won") in _select && MAX('Forecast (Billing)'[Opportunity Status]) in _select&& MAX('Forecast (Billing)'[Product])="Product X",1,
      "Won" in _select&&NOT("Open") in _select && MAX('Forecast (Billing)'[Opportunity Status]) in _select ,1,
      _count =2 &&
      OR(
      MAX('Forecast (Billing)'[Opportunity Status]) =MAXX(FILTER(ALL(Slicer_Table),'Slicer_Table'[Index]=MINX(ALL(Slicer_Table),[Index])),[Opportunity Status]) ,
      AND(
          MAX('Forecast (Billing)'[Opportunity Status])= MINX(FILTER(ALL(Slicer_Table),'Slicer_Table'[Index]=MAXX(ALL(Slicer_Table),[Index])),[Opportunity Status]),MAX('Forecast (Billing)'[Product])="Product X")),1,0)
    #Billing =
    SUMX(
        ALLSELECTED('Forecast (Billing)'),[Billing])

    3. Place [Flag]in Filters, set is=1, apply filter.

    4. Result:

     

    Best Regards,

    Liu Yang

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