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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Yggdrasill
Responsive Resident
Responsive Resident

Fill in gaps in exchange rate table

Hi !

 

Using only one table - What is wrong with this calculated column ?

 

Ex.Rate_cont = 
IF (
    dimDate[Ex.Rate] = BLANK (),
    CALCULATE (
        FIRSTNONBLANK ( dimDate[Ex.Rate], dimDate[Ex.Rate] ) ,
        FILTER ( dimDate, dimDate[Date] <= EARLIER ( dimDate[Date] ) )
    ),
    dimDate[Ex.Rate]
)



See the results below
Trying to fill the gaps with the last registered exchange rateTrying to fill the gaps with the last registered exchange rate

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Yggdrasill,

Please use Dax below instead.

New Value = 
VAR LastNonBlankDate =
    CALCULATE (
        LASTNONBLANK ( dimDate[Date], 1 ),
        FILTER (
            ALL ( dimDate ),
            dimDate[Date]<= EARLIER (  dimDate[Date] )
                && NOT ( ISBLANK ( dimDate[Ex.Rate]) )
        )
    )
RETURN
    CALCULATE (
        SUM ( dimDate[Ex.Rate] ),
        FILTER ( ALL ( dimDate ), dimDate[Date] = LastNonBlankDate )
    )


For more details, please check attached PBIX file.

Regards,
Lydia

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@Yggdrasill,

Please use Dax below instead.

New Value = 
VAR LastNonBlankDate =
    CALCULATE (
        LASTNONBLANK ( dimDate[Date], 1 ),
        FILTER (
            ALL ( dimDate ),
            dimDate[Date]<= EARLIER (  dimDate[Date] )
                && NOT ( ISBLANK ( dimDate[Ex.Rate]) )
        )
    )
RETURN
    CALCULATE (
        SUM ( dimDate[Ex.Rate] ),
        FILTER ( ALL ( dimDate ), dimDate[Date] = LastNonBlankDate )
    )


For more details, please check attached PBIX file.

Regards,
Lydia

Thank you Lydia ! Still wondering what was wrong with my previous formula though ! 

Ashish_Mathur
Super User
Super User

Hi,

 

Does this calculated column formula work?

 

Ex.Rate_cont = IF(dimDate[Ex.Rate]=BLANK(),LOOKUPVALUE(dimDate[Ex.Rate],dimDate[Date],CALCULATE(MAX(dimDate[Date]),FILTER(dimDate, dimDate[Date]<=EARLIER( dimDate[Date])))),dimDate[Ex.Rate])

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur
No, it returns the same result as the original column with blanks on weekends and holidays.

Hi,

 

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Click here

 

does this work ?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors