Forum Discussion

TStan's avatar
TStan
Frequent Visitor
2 years ago
Solved

HELP ME!

Hi there,   I need some DAX code which matches an upload date (today's date) in my fact table to the Date column in my Date Table. I then need a column which returns True if the date falls within t...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  TStan ,

     

    Here are the steps you can follow:

    1. Create measure.

    Flag =
    var _if=
    IF(
        WEEKDAY(MAX('Fact Table'[Date]),2) in {6,7} || MAX('Fact Table'[Date])>TODAY(), BLANK(),
    RANKX(
        FILTER(ALLSELECTED('Fact Table'),
        NOT(WEEKDAY('Fact Table'[Date],2)) in {6,7} &&'Fact Table'[Date]<=TODAY() ),CALCULATE(MAX('Fact Table'[Date])),,DESC))
    return
    IF(
        _if>1&&_if<=8&&_if<>BLANK(),1,0)

    2. Place [Flag]in Filters, set is=1, apply filter.

    3. Result:

     

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly