Forum Discussion

amedvedev's avatar
amedvedev
Frequent Visitor
3 years ago
Solved

Measure evaluating to blank

I have a table with the following columns: [Tenant_ID] (text), [Page_ID] (text), [Pendo_visitor_ID] (text), [NUM_MINUTES] (general), [TIMESTAMP] (date/time) ex. 2022-05-18 2:00:00PM   [Pendo_v...
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    Try this approach/patern

    1. Seperate the time from the time stamp column to extract only the Date column.  Do this in the Query Editor or a calculated column formula in the Data Model
    2. Create a Calendar Table
    3. Create a relationship (Many to One and Single) from the Date column created in step 1 above to the Date column of the Calendar table
    4. Create a slicer and drag Date from the Calendar Table.  Select a certain date in the slicer.
    5. Write this measure

    log in count = countrows('Active users')

     

    log in count in past 45 days = calculate([log in count],datesbetween('calendar'[date],min('calendar'[date])-44,min('calendar'[date]))

     

    Active users = countrows(filter(values('Active users'[Pendo_Visitor_id]),[log in count in past 45 days]>=5))

     

    Active tenants = countrows(filter(values('Active users'[Tenent_id]),[Active users]>=5)

     

    Hope this helps.