March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
Is there a solution for the following problem?
I have a measure ( a simple SUM) that is going to be displayed in a Matrix visual.
I need to filter that value based on a selected version from a slicer.
The issue is that the values from the slicer will change in time. So working with SWITCH ( hardcoded values) is not a solution.
Is there a way to achieve a measure that is recalculated based on the user selection from a slicer?
Now i have the fact table - containing the data used for the SUM and a disconnected table used for slicing the data.
Solved! Go to Solution.
It depends on what you are trying to achieve. If your disconnected table contains values which appear in a column in your fact table, and you want the slicer to choose only those values, you can do something like
Measure with filter = CALCULATE( [Base measure], TREATAS( VALUES('Disconnected table'[Column]), 'Fact table'[Column]) )
Thank you @johnt75 .
I was able to resolve the issue by using SELECTEDVALUE
That's good, but bear in mind it will not work if the user selects multiple options from the slicer, it will perform the same calculation as if they made no selections. TREATAS will work for 0, 1 or more selections
It depends on what you are trying to achieve. If your disconnected table contains values which appear in a column in your fact table, and you want the slicer to choose only those values, you can do something like
Measure with filter = CALCULATE( [Base measure], TREATAS( VALUES('Disconnected table'[Column]), 'Fact table'[Column]) )
Using TREATAS might be a better solution but keep getting the error:
Not sure if this will work, but you could try duplicating the TREATAS, one version using 'Table'[Version.Version Level 01] and one version using 'Table'[Version.Version Level 01.Key]
Just tried it...not a solution. the message stays the same. But anyway. the solution is ok, just need to make sure to set it to single select.
Thank you @johnt75
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |