Forum Discussion

hassanh2's avatar
hassanh2
Helper I
2 years ago
Solved

Date Slicer selected value

Hello, I have a table where i need to update a flag in a specific column based on "selected value" from a date slicer.
I have the following measure, it works only when I hardcode the date as Date(YYYY,MM,DD) but when using any of the other below (commented) dynamix options it doesnt work.

VAR max_Adm_Dt = Date(2023,12,31) // [m_Max Adm Dt_Test] //  SELECTEDVALUE('Calendar'[Date]) // CALCULATE(MAX('Calendar'[Date]),ALLSELECTED())
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi hassanh2,

    Did this field you meanitons is a calculated column? If that is the case, I think you can't use calculated column to achieve this requirement.
    AFAIK, current power bi does not support to create dynamic column/table based on filter effect. They do not work on the same level and the child not able to affect the parent level.

    Notice: the data level of power bi(from parent to child level)

    Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

    Regards,

    Xiaoxin Sheng

4 Replies

  • hassanh2 , I think the measure in the comment should work.

     

    Test on a new page with not filter and no slicer and then test with date slicer. I think some other filter is making value blank

    below should also work

    CALCULATE(MAX('Calendar'[Date]),ALLSELECTED())

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi hassanh2,

    Did this field you meanitons is a calculated column? If that is the case, I think you can't use calculated column to achieve this requirement.
    AFAIK, current power bi does not support to create dynamic column/table based on filter effect. They do not work on the same level and the child not able to affect the parent level.

    Notice: the data level of power bi(from parent to child level)

    Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

    Regards,

    Xiaoxin Sheng

    • hassanh2's avatar
      hassanh2
      Helper I

      Hello Anonymous, you are absolutely right, It is a calculated column. Thanks for expalaining the issue in details.
      So is there any work around to achieve this (Updating a calculated column based on a filter) ?
      Regards,

      Hesham

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI hassanh2,

        You can create a query parameter and turn on the 'enable load' option on query editor side to load it as a table.

        Then you can extract the generated table field values as parameter to create calculated column.

        After these steps, the calculated column result will be changes if you modify the query parameter values and refresh on the data source.

        Regards,

        Xiaoxin Sheng