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

Trouble getting a count in last 30 days for visual

@Link to members, content

 

I am having trouble counting the number of IDs in my visual for the last 30 days.  I have the correct counts on a card, but cannot create the measure.  The measure is as follows: 

 

CCD Last 30 = CALCULATE (
    Count ( 'virtbk notes'[Id] ),
    DATESINPERIOD ( MAX('virtbk notes'[DateTimeUtc]), MAX ( 'virtbk notes'[DateTimeUtc] ), -30, DAY )
)
Here are my cards, I need measures that will calculate the number of IDs in the last 30 days
 
evester_0-1704809413913.png

Any help would be greatly appreciated. 

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

IDNameDateNote
45612Jane Doe12/8/2023CCD - In process
12548Mark Dane12/9/2023CCD - Settled
06458Shelly Craft1/2/2024CCD - Settled
15487Harold Dunn11/30/2023CCD In Process
48757Mark Twain12/9/2023CCD - In Process

View solution in original post

11 REPLIES 11
imnewpbiuser568
Frequent Visitor

Last 30 Days =
var maxdate = MAX(Date_data[Date])
return
CALCULATE(
    COUNT(Customer_data[Customer ID]),
    DATESINPERIOD(Date_data[Date],maxdate,-30,DAY)
)
 
VijayP
Super User
Super User

@Anonymous  IF you can provide some sample data I can help !




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!


Anonymous
Not applicable

IDNameDateNote
45612Jane Doe12/8/2023CCD - In process
12548Mark Dane12/9/2023CCD - Settled
06458Shelly Craft1/2/2024CCD - Settled
15487Harold Dunn11/30/2023CCD In Process
48757Mark Twain12/9/2023CCD - In Process
Anonymous
Not applicable

@VijayP 

I need counts in the last 30 days for all and I need another measure for count in last 30 days where the note type is SETTLED

Anonymous
Not applicable

Ok I will send sample data over shortly, i have to create it

VijayP
Super User
Super User

@Anonymous 

DATESINPERIOD ( [DAtetimeutc]MAX ( 'virtbk notes'[DateTimeUtc] ), -30DAY )

try this.




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!


@Anonymous If my answer is helping you please mark it as solution!




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!


Anonymous
Not applicable

Vijay, 

I am getting this error when trying your formula

evester_0-1704810694724.png

 

you added an extra parenthesis

Screenshot_3.png

Anonymous
Not applicable

Removed the Paren and still get this error

evester_0-1704819880989.png

 

you must have a food calendar table with no repeating dates and no space

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