Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
98 | |
78 | |
66 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |