Forum Discussion

PBI5851's avatar
PBI5851
Helper V
4 years ago
Solved

Adding Targets to Matrix

Hello,

Please can you help me in adding target to the matrix. I tried to add a measure as Target =2 and it works for individual records but it does not sum and in the total it shows as 2 rather than summarized. Not sure how else to add this target. 

 

My raw data as

TMRDOrdIDOrdStatusOrdStatusDateRegion
John SmithSteve TannerABC123Entered1/1/2022West
John SmithSteve TannerABC123Shipped1/5/2022West
John SmithSteve TannerABC123Complete2/10/2022West
John SmithSteve TannerABC234Entered1/1/2022West
John SmithSteve TannerABC234Shipped1/10/2022West
John SmithSteve TannerABC234Complete1/15/2022West
John SmithSteve TannerABC345Entered2/5/2022NW
John SmithSteve TannerABC345Shipped2/7/2022NW
John SmithSteve TannerABC345Complete2/10/2022NW
Mary JaneBridget FDEF123Entered2/5/2022East
Mary JaneBridget FDEF123Shipped2/5/2022East
Mary JaneBridget FDEF123Complete2/5/2022East
Brad MarleyJohn QEFG123Entered2/16/2022East
Brad MarleyJohn QEFG123Entered2/16/2022East
Brad MarleyJohn QEFG123Entered2/16/2022East
Brad MarleyJohn QEFG234Entered2/16/2022West
Brad MarleyJohn QEFG234Entered2/16/2022West
Brad MarleyJohn QEFG234Entered2/16/2022West

 

Expected to have two outputs. When adding region, though John Smith shows up twice, he still has a target of 2 per region and when region is not displayed, he is still supposed to have 2 as the target.  And the totals should sum up correctly. 

 

Output 1:

 TMRegionComplete CountComplete Target
 John SmithWest22
 Mary JaneEast12
 John SmithNW12
 Brad MarleyEast12
 Brad MarleyWest12
Total  610

 

Output 2:

 TMComplete CountComplete Target
 John Smith32
 Mary Jane12
 Brad Marley22
Total 66
  • Hi, maybe I misunderstand you, please try this one

     

    complete_target =

      var target = 2

      return SUMX(SUMMARIZE(datatable,TM column),target)

     

3 Replies

  • HoangHugo's avatar
    HoangHugo
    Solution Specialist

    Hi,

    try this one

     

    measure

    complete_target =

      var target = 2

      return SUMX(datatable,target)

    • HoangHugo's avatar
      HoangHugo
      Solution Specialist

      Hi, maybe I misunderstand you, please try this one

       

      complete_target =

        var target = 2

        return SUMX(SUMMARIZE(datatable,TM column),target)