Hi,
I would like to identify the minimum data in a table while considering also the date range selected by a slicer.
As a measure the following code provides the expected result.
FirstDateSelected =
calculate(
min(Data[Date]),
ALLSELECTED(Data[Date])
)
However, the same code does not work with a calculated column, I'm assuming because of the automatic row context of calculated columns.
I tried
FirstDateSelectedCalculatedColumn =
calculate(
min(Data[Date]),
allselected(Data)
)
in a calculated column, it seems to ignore the row context but does not consider anymore the selected dates in the slicer.
How can I ignore the row context keeping the filter context in a calculated column?
Thanks in advance
Solved! Go to Solution.
Hi,
Calculated column formulas do not respond to changes in slicers. Calculated columns are recalculated only when you press Refresh.
Hi @ITManuel
A calculated column is computed when it's created and during data refresh. Then the column results are stored in the data model. It does not depend on user interaction in the report such as filters, slicers and so on.
If you want to get different results based on slicers, you should use measures rather than calculated columns. See more differences between them and when to use each one:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
https://blog.enterprisedna.co/power-bi-calculated-column-vs-measure-a-comparison/
Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
Hi,
Calculated column formulas do not respond to changes in slicers. Calculated columns are recalculated only when you press Refresh.
@ITManuel you need to add another disconnected table for the slicer and then use that to get the minimum date.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
116 | |
62 | |
59 | |
48 | |
39 |
User | Count |
---|---|
111 | |
65 | |
63 | |
51 | |
48 |