Forum Discussion

tbones's avatar
tbones
Helper II
4 years ago
Solved

Summarize + All(single Column)?

Hello all,

 

I have among others one table "Activities" with activities in different territories (see in attached screenshot).

 

Example is that territoy TerrA got 3 activities in January 21 over 2 days:

 

  • overall activities per field day would be: 3/2 ->> 1,5
  • if this is visualized per channel, it would be:
    • 1,0 F2F activity per field day
    • 0,5 Email activity per field day

 

Target: Get a stacked bar chart for activities per field day for each channel

  • 1,0 F2F
  • 0,5 Email
  • 1,5 total

thank you for your help!

 

  • this should work if there are no other considerations

     

    Activities Per day =
    var NoofDays = CALCULATE(DISTINCTCOUNT(Activities[date ]),REMOVEFILTERS(Activities[channel]))
    return DIVIDE(Activities[Activities], noofdays, 0)

     

    see file attached

8 Replies

  • Hi vanessafvg ,

    thanks for quick reply.

     

    Sorry for the screenshot. Is it sufficient to copy+paste here the Excel data?

    Please tell in case an upload is needed (and where to upload best):

     

    Activities    
    date territoryproductaccountchannel
    1.1.21TerrAProdAAccAF2F
    1.14.21TerrAProdBAccBEmail
    1.14.21TerrAProdBAccBF2F
    1.26.21TerrBProdAAccAF2F
    2.2.21TerrAProdAAccAF2F
    2.3.21TerrAProdBAccBEmail
         
         
         
    Example:    
         
         
    TerritoryTerrA   
    Year Month2021 Jan   
         
    Field Days: 2   
    Activities:3   
         
         
         
    Activities per Field Day   
     F2FEmail  
     10,5  
         
    • vanessafvg's avatar
      vanessafvg
      Community Champion

      see attached but its incomplete  and not sure what other requirements it needs.

       

      What is the definition of the values per day under email 0,5?  

       

      see file attached to start.

  • Hi vanessafvg ,

     

    thanks for the reply!

     

    I had also the activities and days already, but struggeling for the combination with channels.

    Sorry for inaccurate explanation. I try to give more infos.

     

    Activities per day and channel is what I need.

    For F2F it would be this calculation for the given example (January 21, TerrA):

    • 2 F2F activities
    • 2 days with activities
    • >> 2 F2F activities per total 2 days with activities = 2/2 = 1
    • >> TerrA is having one F2F activity per active day

    For email it would be this calculation for the given example:

    • 1 email activity
    • 2 days with activities
    • >> 1 email activity per total 2 days with activities = 1/2 = 0,5
    • >> TerrA is writing 0,5 emails per active day

     

     

    The target is this one - this is what I need:

     

    • vanessafvg's avatar
      vanessafvg
      Community Champion

      this should work if there are no other considerations

       

      Activities Per day =
      var NoofDays = CALCULATE(DISTINCTCOUNT(Activities[date ]),REMOVEFILTERS(Activities[channel]))
      return DIVIDE(Activities[Activities], noofdays, 0)

       

      see file attached
      • tbones's avatar
        tbones
        Helper II

        Thank you.

        the attached PBIX looks good and it seems to work well.

        After creating the measure in my modell using copy-paste strangely it didn't work.

         

        it must be the part:

        var NoofDays = CALCULATE(DISTINCTCOUNT(Activities[date ]),REMOVEFILTERS(Activities[channel]))

        -> when I test this in separate measure it returns me for each channel the filtered (by channel) value like here:

         

        ChannelNoofday
        F2F1
        Email1
        Total2

         

        I would expect this:

        ChannelNoofday
        F2F2
        Email2
        Total2

         

        What could be the reason?

  • I found the reason.

    I have a calculated column to sort the "channels" column using relationship to another channel sorting table.

    after adding REMOVEFILTERS also to this "channel_sort" column it worked.

    Tricky...

     

    Thank you any way!!