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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.