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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
benohara
Regular Visitor

Using date name and datesinperiod

I'm missing something simple, please help!

 

I have a fact table and a date dimension linked on an integer surrogate key. The date dimension has the full date and also a Date Name column, so we can have slicers like "Today" and "Yesterday", and I can easily count how many events happened today

 

Calls Received = COUNTROWS('Fact Call Records')

 

 

 But when I'm trying to count how many happened in the last 30 days, I'm struggling.

 

Calls Received in Last 30 Days = 
    var SelectedDate = MAX('Dim Date'[FullDate])
    RETURN
    CALCULATE(
        'Fact Call Records'[Calls Received]
        ,DATESINPERIOD('Dim Date'[FullDate],SelectedDate,-30,DAY)
    )

 

 

works when FullDate is used as the slicer, but when I slice using DateName it returns the same as the single day count.

 

What am I missing?

1 ACCEPTED SOLUTION
benohara
Regular Visitor

Typical, 9 minutes after posting I work out the solution. 

My date dimension wasn't marked as a date dimension. Right clicking on it and setting the full date field made it work as expected!

View solution in original post

1 REPLY 1
benohara
Regular Visitor

Typical, 9 minutes after posting I work out the solution. 

My date dimension wasn't marked as a date dimension. Right clicking on it and setting the full date field made it work as expected!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.