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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DDL1976
Frequent Visitor

Lookup Value with filters

Hi there,
 
I need to find the finacial period number from a table based on the current date filter on the page, the DAX below works most of the time except for periods where our data is a bit weird...
 
CFP = LOOKUPVALUE(
DimPeriod[Financial Period],
DimPeriod[Period End Date],
LASTDATE(DimPeriod[Period End Date]))
 
The DimPeriod Table looks a little like this...
Period End DateFinancial YearFinancial PeriodDescription
28/02/20212020/2111Febuary 2021
31/03/20212020/2112March 2021
31/03/20212020/21 YE March 2021
30/04/20212021/2201April 2021

 

Assuming my page date filter is set as on/before 31/03/2021 I want to return the value of 12 based on the table above.

 

Any Ideas would be most welcome!
Thanks!!!!

1 REPLY 1
amitchandak
Super User
Super User

@DDL1976 , Not very clear. The best way is have FY Period on you date table, and then you can get period for any selected value in slicer from date table

 

Measure  =

var _max = allselected('Date'[FY Period])

return

////// Your calculation

 

You can not use slicer value in a column calculation

 

Creating Financial Calendar - From Any Month
https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calend...

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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