Forum Discussion

MikeBresnan's avatar
MikeBresnan
Helper I
5 years ago

Count function not working?

I'm having issues with a count function not working. I tried it as a measure, and as a function within the value, but my count is way off. The field i'm trying to count has all unique values, so as far as i can tell it's not aggregating anything. in my data i have two distinct fields (row id, and doc number) that are both giving the same result. it's weird...

 

for this matrix visualization, i'm summing the dollar values of incoming funds, and displaying a count of transactions. for one entity, i have one payment with a dollar amount, but the count is showing no value. 

 

Has anyone seen this sort of issue before?

6 Replies

  • The question is too vague. Please provide sample data in usable format (not as a picture) and show the expected outcome.

    • MikeBresnan's avatar
      MikeBresnan
      Helper I

      Not sure how to attach a file, but here is a cropped version of the data i'm working with.

      <can't add a table?>

      I'm creating a very simple matrix visual that totals (for YTD as of March 31, 2021) the dollar amounts (amount_c) and count the number of transactions (either id or name, i've tried both) for the same time frame. I have the CreatedDate field linked to a date table, and use a YTDTOTAL measure based on that date field, and a sum measure to get the dollar amount. that value is correct in the measure, but the count is off.

       

      for CO B, in power bi, i get the correct dollar amount ($1.029 million), but a count of null/0 instead of the correct value: 1. For CO A, i again get the correct dollar amount ($7,569.00) but a count of 2, instead of the correct value: 5 

       

      Could there be an issue with the relationship between the date field in the source data and the date table? if i create the same measure on a separate report (same dataset), but base it on the createdate, i get an accurate result. i'm not sure what a potential issue could be? also, i'd assume the dollar amount would incorrect as well, in that case.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello MikeBresnan 
      Is this your expected output?

       

      • MikeBresnan's avatar
        MikeBresnan
        Helper I

        Yup! that's what i would expect to see. If i create the YTDTOTAL measure based on that created date field, it's what i get. When i use the date table it's linked to, the count gets thrown off.