Forum Discussion

gareta's avatar
gareta
Frequent Visitor
9 years ago
Solved

How to model data to generate dynamic rates with selectable dimensions

I'm looking for ideas for how to model and measure event rates across an inventory which also changes daily. I've solved this in prototype but suspect there are more refined models that might make th...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi gareta

    Firstly, only when you have an entry for Date 1/2 in EventTable, you are able to get the following desired result.

     

    Create the following measures in your EventTable, please note that there is no relationship between two tables.

    Workers = COUNTROWS(FILTER(WorkerTable,WorkerTable[Date]=MAX(EventTable[Date])))
    Occurrences2 = CALCULATE(COUNTA(EventTable[Event]),FILTER(EventTable,EventTable[Event]<>""))
    Rate 2 = IF(ISBLANK([Occurrences2]/[Workers]),0,[Occurrences2]/[Workers])

    Then create a table visual using fields and mesaures of EventTable as shown in the following screenshot.

     

    Secondly, if you don’t have record for  Date 1/2 in EventTable,  create the measures below, and you will get the following table visual.

    Occurrences = COUNTA(EventTable[Event])
    Workers = COUNTROWS(FILTER(WorkerTable,WorkerTable[Date]=MAX(EventTable[Date])))
    Rate = [Occurrences]/[Workers]


    Thirdly, could you please describe more details about how you get the numbers of workers for 1/2, 1/3 in your last screenshot? Based on my test, when we group events of any type of above table visual, we just need to exclude Event field from the table visual. But this way, I get different numbers of workers for 1/2, 1/3.


    Thanks,
    Lydia Zhang