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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Return a value based on a postingdate

Hello Community

 

I have checked some posting and I am not sure how to go about this.

 

I have 2 tables

Table1 has some items, amounts and a saledate

Table2 has the date ranges and the week number


Table 1

ItemSaleDate(ddmmyyy)Amount
abc0101202083
def1801202073
ghi1902202011
jkl1801202027

 

Table 2 (date table)

StartDate (ddmmyyy)EndDate (ddmmyyy)PeroidName
0101202007012020W1
0801202015012020W1
1601202023012020W2
   

 

What I need is to return the PeroidName that falls inbetween the date rate. Without calculating the sum on that day.

 

Thank you kindly

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

I assume you are looking for a calculated column.  You can try this expression:

 

PeriodName = var datethisrow = Table1[SaleDate]

return Calculate(min(Table2[PeriodName), Filter(All(Table2), Table2[StartDate] <= datethisrow && Table2[EndDate]>= datethisrow))

 

If this solution works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.