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.
Hello,
I've tried to google/search the subject of this post - haven't found what I'm looking for.
If I missed it and someone has a link, please share!
I have a slicer at the top of my page:
I want the slicer to act on every column in my matrix except one:
Location | Number1Oct20 | Number2Oct20 | Number3Oct20 | Number3Apr21 |
North | 14 | -3 | -2 | |
South | 23 | -0.5 | -0.50 | |
East | 12 | -1.30 | -1.10 | |
West | 8 | -0.09 | 0.00 |
Number3Apr - is supposed to be the furthest "future" number we have available in the system.
Without the Slicer on the page, I would have written a Dax Measure as follows:
Calculate (sum (Table1[Number3]), Filter(Table1, Table1[Date] = Max (Table1[Date])))
This almost gets me there:
Calculate(
Sum (Table1[Number3]),
All (Table1),
Filter(Table1, Table1[Date] = Max (Table1[Date]))
)
But it takes away the Row Context (ie same number for every location).
Is there any way to write it and get the Location Context?
Appreciate any help or advice. TYIA.
Solved! Go to Solution.
Hi @kressb
Try this code.
Number3 Apr21 =
VAR _MaxDate =
MAXX (
FILTER ( ALL ( Table1 ), Table1[Location] = MAX ( Table1[Location] ) ),
Table1[Date]
)
RETURN
CALCULATE (
SUM ( Table1[Number3] ),
FILTER (
ALL ( Table1 ),
AND ( Table1[Date] = _MaxDate, Table1[Location] = MAX ( Table1[Location] ) )
)
)
My Sample looks like below.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @kressb
Try this code.
Number3 Apr21 =
VAR _MaxDate =
MAXX (
FILTER ( ALL ( Table1 ), Table1[Location] = MAX ( Table1[Location] ) ),
Table1[Date]
)
RETURN
CALCULATE (
SUM ( Table1[Number3] ),
FILTER (
ALL ( Table1 ),
AND ( Table1[Date] = _MaxDate, Table1[Location] = MAX ( Table1[Location] ) )
)
)
My Sample looks like below.
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@kressb not sure if I understood what you are trying to achieve. It will be easier if you share pbix file with the expected output and let's go from there. Remove sensitive information before sharing. You can share using onedrive/google drive
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.
Calculate(
Sum (Table1[Number3]),
Filter( AllExcept (Table1,Table1[Location]), Table1[Date] = Max (Table1[Date]))
)
@Anonymous Sorry, these don't work. same number for every location.
@amitchandak, @Greg_Deckler hm could you weigh in? a link or any small direction?
Calculate(
Sum (Table1[Number3]),
AllExcept (Table1,Table1[Location]),
Filter(Table1, Table1[Date] = Max (Table1[Date]))
)
Result did not change, still no row context.
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 |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |