The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
The slicer and the matrix in the screenshot below both reference the same date table. The Date table has every day between 1/1/1995 to 12/31/2024.
How can I get the MIN and MAX date from the AsOfDate slicer and reference in the matrix? If I just calc min/max date it only displays MIN/MAX for the current year - as is grouped in the matrix. If I use ALL it removes all filters and doesn't even use the slicer filter dates. So, I'd want the calc to display (MIN) 5/13/2006 in every cell in the matrix - and MAX of 3/20/2019.
This is needed for financial calcs we are performing.
Appreciate any assistance you can provide.
Thanks,
Dan
Solved! Go to Solution.
Hello @dancarr22
ALLSELECTED is your friend here 🙂
The expression
CALCULATE (
MIN ( 'Date'[Date] ),
ALLSELECTED ()
-- or ALLSELECTED ( 'Date' )
)
evaluated at the "top level" of a measure used directly in the visual will return the minimum date ignoring filters due to grouping within the visual (roughly speaking), which in your case should be the minimum filtered on the slicer.
Similarly for max date.
See this article for a full discussion of ALLSELECTED:
https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/
Does this work for you?
Regards,
Hello @dancarr22
ALLSELECTED is your friend here 🙂
The expression
CALCULATE (
MIN ( 'Date'[Date] ),
ALLSELECTED ()
-- or ALLSELECTED ( 'Date' )
)
evaluated at the "top level" of a measure used directly in the visual will return the minimum date ignoring filters due to grouping within the visual (roughly speaking), which in your case should be the minimum filtered on the slicer.
Similarly for max date.
See this article for a full discussion of ALLSELECTED:
https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/
Does this work for you?
Regards,
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |