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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Find Latest date

Hi All,

 

The data that I have has all the surverys that were done to all the stores.

I want to consider only the latest visit to a store for that month. If the store was not visited on that month, then consider the last visited data irrespective of the month. Something like below

 

Store Number   July        Aug

1001                  12-06     25-07

1002                  22-06     22-06

 

In the above example, since Store 1002 was not visited in Aug, it should show me the last visit date. I'm using the below example, this shows blank instead of 22-06

 

Lastvisit = CALCULATE(LASTDATE(FACT_DETAILS_KPIS[session_date]),ALLEXCEPT(FACT_DETAILS_KPIS,FACT_DETAILS_KPIS[store_number],DIM_DATE[fiscalmonth]))
 
Thanks,
Bhavya

 

 

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Bhavya,

 

Since you have a Date table, it could be a simple measure like below. Please download the demo from the attachment.

Measure =
CALCULATE (
    MAX ( FACT_DETAILS_KPIS[Visit Date] ),
    FILTER ( ALL ( DIM_DATE ), DIM_DATE[Date] <= MAX ( DIM_DATE[Date] ) )
)

Find-Latest-date

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Bhavya,

 

Since you have a Date table, it could be a simple measure like below. Please download the demo from the attachment.

Measure =
CALCULATE (
    MAX ( FACT_DETAILS_KPIS[Visit Date] ),
    FILTER ( ALL ( DIM_DATE ), DIM_DATE[Date] <= MAX ( DIM_DATE[Date] ) )
)

Find-Latest-date

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is one step closer to what I needed but I can't replicate the results. It's only showing the latest record I have.

Capture.PNG

I'm trying to display the latest ACTIVE amounts per location per month (but latest record not summed up), I think finding the latest dates per month is close to that goal.

 

Here is my file:

SamplePBIX 

Anonymous
Not applicable

Hi Dale,

 

Thank You so much. This is very helpful. 

I also need to apply this in my KPI calculation. I need to find difference between distribution Sku every month vs July. If Distribution sku for a particular month doesn't exist( like Aug in the below example), then we need to consider the last distribution sku(in this case- July) and then find the difference.

 

PBI Screenshot.PNG

Any help will be much appreciated.

 

Thank You,

Bhavya

Hi @Anonymous,

 

It seems the old question. Can you share a dummy sample that is similar to your real data? The main idea is to find the last date and then sum up the sku value where the date equals the last date. 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
LivioLanzo
Solution Sage
Solution Sage

Hello - are you able to share your dataset?? thanks

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.