Forum Discussion

emilygmd's avatar
emilygmd
Regular Visitor
2 years ago

Power Bi Fechas

Tengo dos filtros sincronizados, de diferentes consultas ambos. Quiero que al consultar una fecha en el primer filtro en el segundo se le agreguen 30 días a la fecha inicial consultada. Es para un tablero, por lo cuál quiero que se ponga la fecha a consultar solo una vez.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi emilygmd ,

    One possible solution is to use the offset columns in your date table. Offset columns are columns that represent the difference of that date (in days, months, quarters, and years) to today’s (day, month, quarter, and year) date.

    Assuming you have a date table with an offset column called Day Offset, you can create a measure like this:

    Date Filter =
    VAR SelectedDate =
        SELECTEDVALUE ( 'Date'[Date] )
    VAR OffsetValue =
        SELECTEDVALUE ( 'Date'[Day Offset] )
    RETURN
        IF (
            ISBLANK ( SelectedDate ),
            BLANK (),
            CALCULATE (
                MAX ( 'Date'[Date] ),
                FILTER ( ALL ( 'Date' ), 'Date'[Day Offset] = OffsetValue + 30 )
            )
        )
    

    This measure will return the date that is 30 days after the selected date in the first filter. You can then use this measure in the second filter as a single value. This way, when you change the date in the first filter, the second filter will automatically update to show the date that is 30 days later.

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

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