Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MikeBresnan
Helper I
Helper I

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 6
MikeBresnan
Helper I
Helper I

OK, lets try this again: here is the link to the cropped version of the sample data

 

https://drive.google.com/file/d/15z5LWjmO3urWuTaCv5YwKDKY2xdDiEmk/view?usp=sharing

 

The pivot table in Sheet2 shows how the data should be calculating

 

power bi example.jpg

 

and here's how it shows in Power BI

power bi example2.jpg

Thanks for all the help/patience!

 

Anonymous
Not applicable

Hello @MikeBresnan 
Is this your expected output?

TarunSharma_0-1623823415272.png

 

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.

lbendlin
Super User
Super User

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

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.

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.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.