Forum Discussion

skavan's avatar
skavan
Frequent Visitor
7 years ago

Dynamic Frequency Distribution (Across 2 Tables)

Hi,

Banging my head on the wall on this one.

I have Table A (simplified) - which is a master list of users:

user_id

and Table B - which is a detail of games played over time by users (simplified):

game_id
user_id
play_date

A user may have multiple entries in Table B.

The tables are linked, one to many, on user_id.

 

I want to show, for a given date range (play_date, set as a Visual Filter), the played game frequency distribution. i.e. Over the last 30 days, 5 people have played 2 times, 11 people have played 3 times etc...

 

It's easy enough to get the computed data into a table by dropping in a field from Table B and simply using Count.

 

It's also easy to create a measure in Table A with the data:

games_played = COUNTROWS(RELATEDTABLE('Table B'))

But - using a histogram, or a bar chart, I can't use the measure, nor can I seem to use a computed data value.

The result should be something like the below, which tells me that most users play once or twice per period. The trick is also, that the period, as mentioned above should be a visual filter, so I can show multiple charts over different date ranges!

 

 

 

2 Replies

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    skavan ,

     

    I'm afraid measures can't be placed to the X-axis section in a histogram visual. You should use calculate column instead.

     

    Regards,

    Jimmy Tao

    • skavan's avatar
      skavan
      Frequent Visitor

      calculated column (as I understand it, is not dynamic and so won't recalc based on filters or am I misunderstanding something?