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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

MIN Date filtered table not returning rows

Hi all, I'm trying to get a measure to return a value for an earlier period - this could be weeks, months or someother grouping from our Dim Date.

 

I have a working measure which returns the sum of a table filtered by MAX('Dim Date'[DateKey]) from the date dim in the columns of a matrix.

 

Accounts Count:= CALCULATE(
SUM('Fact Account Balance'[Account])
,FILTER(
'Fact Account Balance'
,'Fact Account Balance'[BalanceDateKey] = MAX('Dim Date'[DateKey])
)
)

 

I can run this without issue and it returns the value for the first day in the period:

POP Accounts Count:= CALCULATE(
SUM('Fact Account Balance'[Account])
,FILTER(
'Fact Account Balance'
,'Fact Account Balance'[BalanceDateKey] = MIN('Dim Date'[DateKey])
)
)

We have in Dim Date a Column called PreviousDateKey which contains the DateKey for the previous day. When I run I get no rows returned:

 

POP Accounts Count:= CALCULATE(
SUM('Fact Account Balance'[Account])
,FILTER(
'Fact Account Balance'
,'Fact Account Balance'[BalanceDateKey] = MIN('Dim Date'[PreviousDateKey])
)
)

 

Ideally I'm looking for the row with POP Accounts Count to have the value of the preceding column's Accounts Count: NB the dates along the top are week ending dates and are what I'm grouping by in this case.

 

image.png

 

 

Any ideas how to make this work?

 

Thanks, RobJ.

 

3 REPLIES 3

Hi @Anonymous ,

 

was your problem solved?

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

Thanks Amit,

 

I think I'm missing something, can you elaborate on how your last post regarding period on period measures can be used in my context please.

 

Thanks, RobJ.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors