Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Loop check in power Bi

Hi all,

 

I want to find result on basis on date marked in red, means I'm trying to check date(red one) falls between which group (valid from & expiry date) in data table and get base rate. Already make a unique with col. A, B & C  of data table and query table.   

For above query 02-01-2018 fall in between (01-06-2017 to 31-12-2018) last row of data table and result = USD 515.00.

 

Can anybody help me how to get desired result.

 

Thanks in advance.

2 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Icon for Microsoft Employee rankMicrosoft Employee

    HI Anonymous

     

    This calculated measure will show one way to get the base rate

     

    Base Rate = 
    VAR myDate = DATE(2018,2,1)
    RETURN 
        MINX(
            FILTER(
                ALL('Table1'),
                'Table1'[Valid From] <= myDate &&  myDate < 'Table1'[Expire date]
                ),'Table1'[Base Rate])
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi