Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello community,
I have a dataset like this:
ID, Consistent, Deviation.
I want to remove rows where Consistent < 15 and Deviation > 90, which is easy with a new column:
is_bad = if (Consistent < 15 AND Deviation > 90, True(), False()), then have a filter that keep only is_bad = False().
However, I want the user of the dashboard to be able to change the 15 and 90 values.
I cannot use two filters to keep Consistent >= 15 AND Deviation <= 90, because I want
Consistent >= 15 OR Deviation <= 90.
I also cannot use the calculated column as before since it does not respond to parameters.
What should I do?
Solved! Go to Solution.
Hi @tzuchiao
You can use what-if parameters as the values to feed to the filter. You can modify its calcualted table formula to reference the max consistent/deviation value so the series of numbers becomes dynamic. This feature generates a series of numbers and which slicer allows for a single value selection using a slider. Please see the attached sample pbix.
You can then use a measure to visually filter your table using an OR logic.
Consistent Deviation Filter =
// This measure calculates the count of rows in 'Table' based on a filter condition.
CALCULATE (
COUNTROWS ( 'Table' ),
// Counts the rows in 'Table'
KEEPFILTERS (
FILTER (
// Applies a filter on 'Table'[Consistent] and 'Table'[Deviation] columns
ALL (
'Table'[Consistent],
'Table'[Deviation]
),
// Filters rows where 'Consistent' is greater than or equal to [ConsistentFilter Value]
// OR 'Deviation' is less than or equal to [DeviationFilter Value]
'Table'[Consistent] >= [ConsistentFilter Value]
|| 'Table'[Deviation] <= [DeviationFilter Value]
)
)
)
Hi @tzuchiao
You can use what-if parameters as the values to feed to the filter. You can modify its calcualted table formula to reference the max consistent/deviation value so the series of numbers becomes dynamic. This feature generates a series of numbers and which slicer allows for a single value selection using a slider. Please see the attached sample pbix.
You can then use a measure to visually filter your table using an OR logic.
Consistent Deviation Filter =
// This measure calculates the count of rows in 'Table' based on a filter condition.
CALCULATE (
COUNTROWS ( 'Table' ),
// Counts the rows in 'Table'
KEEPFILTERS (
FILTER (
// Applies a filter on 'Table'[Consistent] and 'Table'[Deviation] columns
ALL (
'Table'[Consistent],
'Table'[Deviation]
),
// Filters rows where 'Consistent' is greater than or equal to [ConsistentFilter Value]
// OR 'Deviation' is less than or equal to [DeviationFilter Value]
'Table'[Consistent] >= [ConsistentFilter Value]
|| 'Table'[Deviation] <= [DeviationFilter Value]
)
)
)
Hi,
Share the download link of the PBI file and show the expected result there.
@tzuchiao , You have pust this a measures whenever you need
example
Sumx(filter( Table, [Consistent] >= 15 OR [Deviation] <= 90), Table[Value])
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |