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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Count same values from the most recente date

Hi everyone,

 

I want to create a formula which count how many times a specific value shows up in the most recent date.
I made a sample set (see below). I want to know how many times '-1' shows up in the latest month (March). So the answer should be 3.  

DateAspectValue
January 2020Responsibility1
January 2020Validity0
January 2020Satefy-1
January  2020Guarantee -1
February 2020Responsibility0
February 2020Validity-1
February 2020Satefy0
February 2020Guarantee 0
March 2020Responsibility-1
March 2020Validity-1
March 2020Satefy-1
March 2020Guarantee 1
1 ACCEPTED SOLUTION

Hi, @Anonymous 

Try  adding  format function to “Table”[Date]:

measure = 
var _sel = -1
return
CALCULATE(COUNT('Table'[Value]),FORMAT('Table'[Date],"MMMM YYYY")=FORMAT(TODAY(),"MMMM YYYY"),'Table'[Value]=_sel)

Pbix attached

36.png

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

measure =
var _sel = -1
return
calculate(count(table[Value]),Table[date] = format(today(),"MMMM YYYY"),table[value] =_sel)

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
Anonymous
Not applicable

Hi @amitchandak ,

 

Thanks for your reply. 

I cannot see if the measure works, because Power BI shows me the following:

 

Cannot load the data for this visual

In DAX-comparisons it is not supported to make comparisons of values of type Date with values of type Text. 

 

I don't understand this, since the column Value is the type 'Whole value' and not 'Text'. 

Hi, @Anonymous 

Try  adding  format function to “Table”[Date]:

measure = 
var _sel = -1
return
CALCULATE(COUNT('Table'[Value]),FORMAT('Table'[Date],"MMMM YYYY")=FORMAT(TODAY(),"MMMM YYYY"),'Table'[Value]=_sel)

Pbix attached

36.png

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors