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
kkirner
Helper II
Helper II

How can I get an average calculation to work with a relative date filter?

Hi, I have a pretty simple DAX for average closed files. 

Average Closings per Day =
AVERAGEX(
VALUES(SPSRevenue[DatePaid]),
CALCULATE(_MeasuresNonCommission[Closed File Count]))

I enter it into a card w/ the DatePaid filter set to relative date for is in this month - I get "blank" for my answer, when I set the filter for is in the last calendar month, or is in the current year, I seem to get the right answer.
kkirner_0-1657565896022.png

 


Any idea what would cause the "blank" answer?
1 ACCEPTED SOLUTION

@tamerj1 I have to apologize.  I truly made a rookie mistake here.  I never refreshed the data on the desktop version of the report.  I can't even believe I did that, but I did.  I refreshed it after my last reply and I now have data where it previously said "blank".  Thank you for your time and offer to help.

View solution in original post

7 REPLIES 7
kkirner
Helper II
Helper II

@tamerj1 I appreciate the quick reply and yes, I should've put that code in the first thread.  Here you go:

Closed File Count =
CALCULATE([distinctRevenueCount], SPSRevenue[BillCode]="TP")

We do have closed files this month.  The card below is built on the Closed File Count measure, with the DatePaid filter using the relative date of Is in This Month.
kkirner_0-1657571029148.png

 

@kkirner 
Agian you have [distinctRevenueCount] measure. What is the code of this measure?

Sorry about that...here is that measure:

distinctRevenueCount =
var orderCount = DISTINCTCOUNT(SPSRevenue[OrderNumber])
return
IF( orderCount > 0, VALUE(orderCount), IF(orderCount = 0, VALUE(0)))

@kkirner 
Are you sure you have orders in this month with SPSRevenue[BillCode]="TP"?

Yes.  We have revenue every day.  Here's the count from today...it is actually revenue that generates the count.  In other words, we don't count the file until there is revenue realized from it.

kkirner_0-1657639000860.png

 

@tamerj1 I have to apologize.  I truly made a rookie mistake here.  I never refreshed the data on the desktop version of the report.  I can't even believe I did that, but I did.  I refreshed it after my last reply and I now have data where it previously said "blank".  Thank you for your time and offer to help.

tamerj1
Super User
Super User

@kkirner 
Maybe there is no data for "this month"? What is the code of the [Closed File Count] measure?

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.