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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Truelearner
Helper III
Helper III

need help with dax to generate two columns from and to dates in the below table

i want to create from and TO columns based on the effective date i have , From column is same as the effective date but To column is one day less than next effective date . Below is the sample data 

@mgwena @cham @amitchandak @Greg_Deckler @Mariusz 

 

 

base currexchange curreffective daterateFromTO
usdINRdec-31-201970.23dec-31-2019jan-30-2020
usdINRjan-31-202070jan-31-2020feb-28-2020
usdINRfeb-29-202071feb-29-2020mar-15-2020
usdINRmar-16-202072mar-16-2020apr-27-2020
usdINRapr-28-202073apr-28-2020may-30-2020
      
      
      
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try new columns like

from =table[effective date]
to = minx(filter(table, table[base curr] =earlier[base curr] && table[exchange  curr] =earlier[exchange  curr]
							&& table[effective date] >earlier[effective date]),table[effective date])-1

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

Try new columns like

from =table[effective date]
to = minx(filter(table, table[base curr] =earlier[base curr] && table[exchange  curr] =earlier[exchange  curr]
							&& table[effective date] >earlier[effective date]),table[effective date])-1

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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