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.
I have a measure to be calculated that should respond to slicers on the page, but it should never filter out a certain subset of rows denoted by a boolean column.
So for the table:
Value | Color | is_filterable |
1 | Yellow | TRUE |
2 | Green | TRUE |
3 | Blue | TRUE |
10 | Red | FALSE |
10 | Orange | FALSE |
the result of sum_measure that sums the Value column but never filters rows where is_filterable = FALSE should look like this:
sum_measure | Color |
21 | Yellow |
22 | Green |
23 | Blue |
20 | Red |
20 | Orange |
How can this be achieved?
Hi all,thanks for the quick reply, I'll add more.
Hi @dataforhumans ,
Regarding your question, you want the line items to be affected by the slicer, but the sum not to be affected by the slicer, correct?
The Table data is shown below:
You can use the 'Calculate' function to override the outer filter condition with the inner filter condition.
Measure = CALCULATE(SUM('Table'[Value]),'Table'[is_filterable] = TRUE() || 'Table'[is_filterable] = FALSE())
Final output
If I understand you wrongly, please provide more information.
Best Regards,
Wenbin Zhou
Hi @dataforhumans ,
Creating a measure will return a value like as if those rows are not filtered but they will not be visible. For example, calculating YTD value as of 2023/12/30 - a measure can return the value for that but once you select that date from a slicer only the selected date will be visible. That's how related colums and tables work. A disconnected table might abe able to achieve this but your post just doesn't have enough information to propose a solution. Please refer to this post on how to get your question answered quickly - https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Proud to be a Super User!
Hi @dataforhumans
The following removes the filter context from your measure: You can try this:
CALCULATE([sum_measure], ALL(is_filterable))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |