Forum Discussion

Microbz's avatar
Microbz
Regular Visitor
5 years ago

Dynamic Gauge Target based on date slicer

Two Tables: 

Sales
DateSalespersonRegionTypeAmount
4/4/2021Timwestred10
4/7/2021Janewestgreen12
4/15/2021Kateeastred23
4/16/2021Johneastblue15
4/19/2021Timnorthblue30
4/19/2021Katesouthgreen12
4/23/2021Katesouthgreen22
4/25/2021Janenorthred32
4/30/2021Timwestblue16
5/1/2021Johnsouthgreen20
5/1/2021Janenorthred10
5/3/2021Johnsouthred12
5/5/2021Kateeastgreen19
5/10/2021Janewestblue18
5/10/2021Timwestblue23
5/11/2021Timwestred25
5/15/2021Johnsouthred33
5/18/2021Katesouthgreen30
Targets
MonthTypeTarget
Aprilred35
Aprilgreen30
Aprilblue40
Mayred30
Maygreen35
Mayblue45

I want a gauge that shows total monthly sales for a type with target for that type. The gauge would be bound to date slicer that would update sum of monthly sales and select corresponding target for that month. The slicer would also interact with other visuals on my dashboard.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Microbz ,

     

    Create MonthType columns in both tables.

    MonthType = FORMAT([Date],"MMMM")&"-"&[Type]

    MonthType = [Month]&"-"&[Type]

     

    Create two measure. Put one of them to Filters, and set Show items when the value is 1.

    Whether to complete the goal = IF(CALCULATE(SUM('Sales'[Amount]),FILTER(ALL(Sales),[MonthType]=MAX('Sales'[MonthType])))>=SUM('Targets'[Target]),"completed","not completed")
    Measure = IF(MAX('Targets'[Month]) in ALLSELECTED('Targets'[Month]),1)

     

     

    Best Regards,

    Stephen Tao

     

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

     

  • Microbz's avatar
    Microbz
    Regular Visitor

    Thanks Anonymous for the response. However, what I was looking for a way to use the monthly targets (table 2) as the target value on a PBI gauge. That way the gauge target would update based on the selected month. So, I would have a gauge for each "type" that would show the sum of sale amounts for that "type" with the target for that "type" for the selected month.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Microbz ,

       

      Do you mean that your Target table is actually your expected result? If not, please give an example to give the expected result style, thank you.

       

      Best Regards,

      Stephen Tao

       

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

      • Microbz's avatar
        Microbz
        Regular Visitor

        This is what I'm shooting for. I would have multiple gauges each filtered on "TYPE" and all bound to date slicer. For each gauge I want the TYPE target related to the TARGET table with the TARGET and SALES tables bound to same date slicer.  This way as the date slicer is changed (by  month) the sales amounts and the target are updated on the gauges.