Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
hi,
say i have a field called Report Date Final (text) that i use as a slicer. I have two values among many rows, April 2025 Final and March 2025 Final. This column also has a orresponding report date ie
Report Date | Report Date Text |
April 2025 | April 2025 - Final |
March 2025 | March 2025 - Final |
March 2025 | March 2025 - Final |
I have the slicer set to March 2025 - final
my measure is using VAR MaxDate = CALCULATE(MAX(Report date)
My questions are:
1) while March 2025 - Final is in the slicer, will MaxDate use March 2025 - Final as the Maximum date? or will it use April 2025 - final as the maximum date?
2) Or is it because I am using ALL it will go to April 2025 - Final.
Here is my measure -
Sample Measure =
VAR MaxDate = CALCULATE(MAX('Table'[Report Date]))
VAR StartDate = EOMONTH(MaxDate, -12) + 1
VAR EndDate = EOMONTH(MaxDate, 0)
RETURN
COUNTROWS(FILTER(ALL('Table'),
'Table'[Birth_Date] >= StartDate &&
Table[Birth_Date] <= EndDate))
thanks.
Solved! Go to Solution.
Hi @wonka1234
Welcome to the Microsoft Fabric Community Forum! Also , thank you @pankajnamekar25 for your response.
Regarding your query on how CALCULATE(MAX([Report Date])) behaves in the presence of a slicer on 'Report Date Text', here is a detailed explanation:
When you apply a slicer on 'Report Date Text' (e.g., "March 2025 - Final"), this filter context is automatically propagated to the related column 'Report Date'.
Therefore, the expression CALCULATE(MAX('Table'[Report Date])) will evaluate the maximum date only within the filtered rows, and return March 2025, not April 2025.
If you want to ignore the slicer filter and compute the maximum report date from the entire dataset, you need to explicitly remove the filter using functions like ALL('Table') or ALL('Table'[Report Date Text]).This will return April 2025, which is the true maximum date in the full dataset.
If this response resolves your query, kindly mark it as Accepted Solution to help other community members. A Kudos is also appreciated if you found the response helpful.
Thank you!
Hi @wonka1234
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @wonka1234
Welcome to the Microsoft Fabric Community Forum! Also , thank you @pankajnamekar25 for your response.
Regarding your query on how CALCULATE(MAX([Report Date])) behaves in the presence of a slicer on 'Report Date Text', here is a detailed explanation:
When you apply a slicer on 'Report Date Text' (e.g., "March 2025 - Final"), this filter context is automatically propagated to the related column 'Report Date'.
Therefore, the expression CALCULATE(MAX('Table'[Report Date])) will evaluate the maximum date only within the filtered rows, and return March 2025, not April 2025.
If you want to ignore the slicer filter and compute the maximum report date from the entire dataset, you need to explicitly remove the filter using functions like ALL('Table') or ALL('Table'[Report Date Text]).This will return April 2025, which is the true maximum date in the full dataset.
If this response resolves your query, kindly mark it as Accepted Solution to help other community members. A Kudos is also appreciated if you found the response helpful.
Thank you!
Hello @wonka1234
It will return March 2025.
This is because
The slicer is applying a filter on 'Table'[Report Date Text].
Unless you explicitly remove that filter, the context remains active inside the CALCULATE.
So your MAX(Report Date) will be evaluated within the filtered context of "March 2025 - Final".
Will it return April 2025 only if I use ALL()?
Yes. If you wrap the column in ALL('Table') or ALL('Table'[Report Date Text]), then you remove slicer filters, and MaxDate will be April 2025 (the true max from the full dataset).
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
User | Count |
---|---|
85 | |
80 | |
74 | |
49 | |
41 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |