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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Hayleysea
Resolver II
Resolver II

Measure showing incorrect value in row of table but total is correct

Hi there, I have a measure as per below which counts ID's as at the earliest date (I have a date filter on my report set to on or after a certain date).


Original ID Count =
VAR __PreviousDate = MIN([Date])
Return
CALCULATE(COUNTA(table[ID]), FILTER(table, [Date]=__PreviousDate))
 
I then use this measure in a table but there is an extra 1 in one of the rows which shouldn't be there. The total is correct (it excludes the 1) as per below
 
IDCount
A1
B5
C7
Total:12

 

As you can see above, ID 'A' has a count of 1 which isn't correct (it should be 0) but the total = 12 which is correct (5+7). How do I get rid of this random 1?

 

Any help appreciated 🙂

3 REPLIES 3
Anonymous
Not applicable

Hi @Hayleysea ,

 

I did some test but didn't meet the same scenario. Can you share some sample data to us?

 

Best Regards,

Jay

amitchandak
Super User
Super User

@Hayleysea , Try like

Original ID Count =
VAR __PreviousDate = MINX(Table, Table[Date])
Return
CALCULATE(COUNTA(table[ID]), FILTER(table, Table[Date]=__PreviousDate))


or


Original ID Count =
VAR __PreviousDate = MINX(Table, Table[Date])
Return
CALCULATE(COUNTA(table[ID]), FILTER(all(table), Table[Date]=__PreviousDate))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
VijayP
Super User
Super User

@Hayleysea 

The Problem Statement is not Clear. As per my understanding created a File use this 

https://drive.google.com/file/d/1Y24Xxh7_TZDR-PJKnt6eb4UW0ExR5xsG/view?usp=sharing

 
This is what I have used and used IF condition as well 
Count =
VAR PD = MIN('DAte Table'[Date])
RETURN
CALCULATE(COUNT('Table'[ID]),FILTER(ALL('DAte Table'),'DAte Table'[Date]=pd))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors