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
First off, sorry for the title. I'm struggling to figure out how to ask the questions appropiately. With that said, here's my question.
Is there a way to display the vaiance between two on-page values that have been created by filtering a single value two different ways?
ie. I have a dollar amount in a single table, let's call it total cost. On the page I display that number in two seperate charts. The chart on the left is filtered by a set of on page slicers which give me a certain value. The chart on the right is filtered by another set of slicers that give me a differnt value. I'm using the edit interactions feature to make these two dissimilar values possible whereby the slicers on one side of tha page do not affect he other side and vise-versa.
My initial thought is that since this value comes from one source (a single table) there's no way for Power BI to reference the different filtered values on the page in a measure to calcualate the difference. Please tell me I'm wrong.
I've attached a screenshot of the scenario I'm talking about.
Solved! Go to Solution.
HI @DJBAJG,
>>My initial thought is that since this value comes from one source (a single table) there's no way for Power BI to reference the different filtered values on the page in a measure to calcualate the difference. Please tell me I'm wrong.
Yes, the fact is similar to your thinking. Current power bi not able to use Dax expression to extract different values from the same data source fields.
For your requirements, you need to extract these field values to create a new table and use the new table fields as the source of the filter. Then you can compare values between two different sources with filter effects.
Regards,
Xiaoxin Sheng
I appreciate the thought but unfortunately duplication of the source table or columns is not an option. We're dealing with TBs of data and the model structure won't support that increase in size. I tried to employ another type of solution using unrelated category tables and a variable selection. It works for a single category, 'Location" in the code below, but I need it to function for multiple slicers/categories. Is there a way to modify the code to accept multiple filters?
The below code works for a single category/slicer:
Median Copay Category 1 =
VAR selectedCategory = ALLSELECTED('Table 1'[Location])
return
CALCULATE([Median Copay],
FILTER('Organization NEW','Organization NEW'[Location] IN selectedCategory))
Can I make it take multiple filters? The code below gives me an error stating "Function CONTAINSROW must have a value for each column in the table expression".
Median Copay Category 3 =
VAR selectedCategory = ALLSELECTED('Table 3'[Location],'Table 3'[Plan Type])
return
CALCULATE([Median Copay],
'Organization NEW'[Location] IN selectedCategory,
'Organization NEW'[Plan Type] IN selectedCategory)
Still need help here....
HI @DJBAJG,
You can consider creating a calculated table with all or values function to choose specific table field values.
NEW Table=VALUES(Table1[Column])
or
NEW Table=ALL(Table1[Column])
Measure formula:
Diff =
CALCULATE ( SUM ( Table1[Amount] ), ALLSELECTED ( Table1 ) )
- CALCULATE (
SUM ( Table1[Amount] ),
FILTER ( ALL ( Table1 ), [Column] IN ALLSELECTED ( 'NEW Table'[Columns] ) )
)
Regards,
Xiaoxin Sheng
HI @DJBAJG,
>>My initial thought is that since this value comes from one source (a single table) there's no way for Power BI to reference the different filtered values on the page in a measure to calcualate the difference. Please tell me I'm wrong.
Yes, the fact is similar to your thinking. Current power bi not able to use Dax expression to extract different values from the same data source fields.
For your requirements, you need to extract these field values to create a new table and use the new table fields as the source of the filter. Then you can compare values between two different sources with filter effects.
Regards,
Xiaoxin Sheng
With that being said I now need a simple visual to show the variance. What I want is a bar that has 0 in the middle and if he variance is positive the bar extends left and is green and if it's negative the bar extends right and is red. I feel this should be easily achievable with a standard clustered bar chart but when I place my variance measure on the chart I don't get and option to set conditional formatting under data colors. I'm open to using a custom visual if necesary, perhaps something with arrows or otherwise noting which scenario is larger or smaller.
Ok, so I guess I jumped the gun. I'm not sure how to execute what you mentioned about extracting the values into a new table and using them as the filter. My dataset is too large to duplicate raw source elements. Were you saying to do that or create something else in a new table??
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 |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |