Forum Discussion
Count function not working?
The question is too vague. Please provide sample data in usable format (not as a picture) and show the expected outcome.
- MikeBresnan5 years agoHelper 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.
- edhans5 years agoCommunity Champion
How to get good help fast. Help us help you.
How To Ask A Technical Question If you Really Want An Answer
How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.