Forum Discussion

New_Folder's avatar
New_Folder
Icon for Helper I rankHelper I
7 months ago
Solved

Count is incorrect. What could have been causing this?

 

What should I be looking for?

 

MH7 is a measure that counts the last 7 days, it should be counting 7, but its just showing 4.

 

MH7 =

CALCULATE(

DISTINCTCOUNT('Utility Allowance Tracker - HDR'[Created]),

FILTER('Utility Allowance Tracker - HDR',

'Utility Allowance Tracker - HDR'[Created] >= TODAY()-7),

'Utility Allowance Tracker - HDR'[Client Name] = "Mercy Housing")

 

  • Hi New_Folder , if possible, share a sample data without sensible content in order to give us an way to replicate your issue. 
    In time, maybe you should check

    1. Whether you intend to count rows or distinct dates.
    2. The actual content and granularity of the Created field.
    3. Hidden filters affecting the visual.
    4. Inconsistencies in Client Name.
    5. Whether the record has Created values that are blank, null or truncated.

       

     

6 Replies

  • When using DISTINCTCOUNT, it literally counts the "distinct" values from the column you're counting, and not the "total" number of values in the column. Try using COUNT() instead of DISTINCTCOUNT() instead. 

    Also, if possible can you share a subset of data from the 'Utility Allowance Tracker - HDR'[Created] column to assist in answering your question?

  • Hi New_Folder , if possible, share a sample data without sensible content in order to give us an way to replicate your issue. 
    In time, maybe you should check

    1. Whether you intend to count rows or distinct dates.
    2. The actual content and granularity of the Created field.
    3. Hidden filters affecting the visual.
    4. Inconsistencies in Client Name.
    5. Whether the record has Created values that are blank, null or truncated.

       

     

  • New_Folder 

    maybe you can create a new measure

    measure=sumx(values(Site Name), MH7)

     

    if this does not work, pls provide some sample data and expected output

  • v-dineshya's avatar
    v-dineshya
    Icon for Community Support rankCommunity Support

    Hi New_Folder ,

    Thank you for reaching out to the Microsoft Community Forum.

     

    You want number of requests, but you are counting distinct Created timestamps/dates. If multiple requests were created on the same day, they collapse into one count.

     

    Please try below measures.

     

    1. If you want requests in last 7 days, try below measure.

     

    MH7 =
    CALCULATE(
    COUNTROWS('Utility Allowance Tracker - HDR'),
    'Utility Allowance Tracker - HDR'[Created] >= TODAY() - 7,
    'Utility Allowance Tracker - HDR'[Client Name] = "Mercy Housing"
    )


    2. If you want a rolling 7-day window including time, try below measure.

     

    MH7 =
    CALCULATE(
    COUNTROWS('Utility Allowance Tracker - HDR'),
    'Utility Allowance Tracker - HDR'[Created] >= NOW() - 7,
    'Utility Allowance Tracker - HDR'[Client Name] = "Mercy Housing"
    )

     

    I hope this information helps. Please do let us know if you have any further queries.

     

    Regards,

    Dinesh

    • v-dineshya's avatar
      v-dineshya
      Icon for Community Support rankCommunity Support

      Hi New_Folder ,

      We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

       

      Regards,

      Dinesh

      • v-dineshya's avatar
        v-dineshya
        Icon for Community Support rankCommunity Support

        Hi @New_Folder ,

        We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

         

        Regards,

        Dinesh