Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
I have a report I'm developing and it works for company level but not when I want to use a slicer to investigate by depot/location.
The background is as follows.
"Sales" is direct calculation based on our weekly import and is working as expected.
"Last Year" is a Dax expression:
So I've added a slicer to this sheet in order to restrict data to "Manchester" but what happens is the sales value as per the imports works fine, but the DAX expression doesn't incorporate the silcer and continues to show the Last Year value for the full company,
(Note: I know there is a time inteligence function for "This Time Last Year" but this won't work with our current data.)
So my question is, are Slicers and DAX expressions compatiable or do I need to change my use of the filter function?
The solution needs to allow for other depot/location data to be selected in the slicer. For example, Should we switch the slicer from Manchester to London, I need the outcome of the DAX expression to update automatically and in accordance with the slicer.
I look forward to hearing a response and developing my user of the filter function, thanks in advance.
Regards,
Chris
Thanks for your response, so I understand that ALL is the problem. In which case can you advise how I would successfully use a filter to get the outcome I desire.
I've read the provided link and expanded into the filter function, do I need to marry the filter with a RELATED?
Please help?
Thanks in advance.
Regards,
Chris
As far as I know, it is something tricky, but you can use a variable to capture the center and use it in your measure.
var _selectedCenter= SELECTEDVALUE(Table[center])
return
Calculate(
SUM(Imports[SALES]),
Filter(
Table [Center]= _selectedCenter,
Imports[Week No]
=MAX(Imports[Week No])-100
)
)
But the problem of doing something when you want to deal with multiple selection or nothing selected... It may be some solution for sure, but I will need to check how to do it
Hi @Anonymous
The problem is that you are using ALL(imports) in your formula, which ignores filters applied (https://learn.microsoft.com/en-us/dax/all-function-dax)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |