Forum Discussion
Measure doesn't work correctly with slicer
HI PwrBI01,
You can create a calculated table with two labels that you mentioned, then you can use raw table date fields on the chart and new table fields as legend, write measure formulas with switch function to show different result based on current date and legend.
DAX – Making the “Case” for SWITCH()
After these steps, you need to create a slicer with date fields that not linked to the current table as source and write a measure to compare the current date and selected date. Then you can use this measure on your chart 'visual level filter' to filter records of selected year and previous year.
Applying a measure filter in Power BI
Regards,
Xiaoxin Sheng
Hi Anonymous,
Thank you for your answer,
That data are the ones I should obtain if the period selected is June 2019 as in the example, but they depends on the period selected in the slicer, they are not always the same data.
Is there a way to create a calculate table with that data changing depending on the slicer? I am not able to do that step
Thanks in advance.
Regards.
- Anonymous5 years agoNot applicable
HI PwrBI01,
Unfortunately, current power bi does not support to create dynamic calculated column/table that based on filter or slicer selections. They are host on different levels and you can't use child-level filters to interact with its parent.
Notice: the data level of power bi.
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