Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Victor_Z
Helper I
Helper I

SUMX dynamically filtered by slicer

Hello everyone

 

I have a table of incidents with multiple columns about  the incident (ticket number, date, time, countries affected, impact time, type of impact, root cause, etc...)

On the other hand I have the following measure for different purposes and calculations:

 

Impact_sg = SUMX(GROUPBY('Table_of_Incidents','Table_of_Incidents'[Impacted Service],'Table_of_Incidents'[Bussiness Process],'Table_of_Incidents'[SLA Impact sg],'Table_of_Incidents'[Impact Type],'Table_of_Incidents'[Affected Panels],'Table_of_Incidents'[Affected Countries]),'Table_of_Incidents'[SLA Impact sg])

 

Now we want to dinamically calculate Impact_sg measure based upon slicer selection from the enduser. 
The slicer selection consists of giving the end user the option of Add or Remove those incidents of Table_of_Incidents that match with a specific condition "Root Cause = External Conditions".

 

I am trying the following DAX formula but it doesn´t work.

New Impact _sg Measure =

VAR ExcludeExternal = SELECTEDVALUE('Incidents Analysis'[Root Cause])

RETURN

SUMX(

        GROUPBY(

         FILTER('Table_of_Incidents', NOT(ExcludeExternal) || 'Table_of_Incidents'[Root Cause] <> "External conditions"),

         'Table_of_Incidents'[Impacted Service],

        'Table_of_Incidents'[Bussiness Process],

        'Table_of_Incidents'[SLA Impact sg],

        'Table_of_Incidents'[Impact Type],

        'Table_of_Incidents'[Affected Panels],

        'Table_of_Incidents'[Affected Countries]),

    'Table_of_Incidents'[SLA Impact sg])

How can I manage to dinamically add/remove those rows of the table that match the criteria?

Any clue?  

Thanks in advance for your help. 

 

1 ACCEPTED SOLUTION
v-sshirivolu
Community Support
Community Support

Hi @Victor_Z ,
Thank you for reaching out to Microsoft Fabric community forum.

Create the disconnected slicer table
RootCauseFilter =
DATATABLE(
"FilterOption", STRING,
{
{"Include External Conditions"},
{"Exclude External Conditions"}
}
)

Add the slicer visual
Use - RootCauseFilter[FilterOption] as the field.
User can now choose to Include or Exclude External Conditions

Create the dynamic measure

Dynamic Impact_sg =
VAR SelectedOption = SELECTEDVALUE('RootCauseFilter'[FilterOption], "Include External Conditions")
VAR IsExclude = SelectedOption = "Exclude External Conditions"

RETURN
SUMX(
GROUPBY(
FILTER(
'Table_of_Incidents',
NOT(IsExclude) || 'Table_of_Incidents'[Root Cause] <> "External Conditions"
),
'Table_of_Incidents'[Impacted Service],
'Table_of_Incidents'[Bussiness Process],
'Table_of_Incidents'[SLA Impact sg],
'Table_of_Incidents'[Impact Type],
'Table_of_Incidents'[Affected Panels],
'Table_of_Incidents'[Affected Countries]
),
'Table_of_Incidents'[SLA Impact sg]
)


Add a card or table to show output

Drag in the Dynamic Impact measure.

Select slicer option and watch values update:

Include - Includes all rows.

Exclude - Excludes those with Root Cause = External Conditions.


Please find the attached .pbix file for your reference.

Regards,
Sreeteja.

View solution in original post

6 REPLIES 6
HarishKM
Memorable Member
Memorable Member

@Victor_Z Hey,
I will use below measure .

 

New Impact_sg Measure =
VAR ExcludeExternal =
SELECTEDVALUE ( 'Incidents Analysis'[Root Cause], "Include All" ) // Default value if slicer not selected
RETURN
SUMX (
GROUPBY (
FILTER (
'Table_of_Incidents',
IF (
ExcludeExternal = "External conditions",
'Table_of_Incidents'[Root Cause] <> "External conditions",
// Exclude External Conditions
TRUE () // Include all others
)
),
'Table_of_Incidents'[Impacted Service],
'Table_of_Incidents'[Bussiness Process],
'Table_of_Incidents'[SLA Impact sg],
'Table_of_Incidents'[Impact Type],
'Table_of_Incidents'[Affected Panels],
'Table_of_Incidents'[Affected Countries]
),
'Table_of_Incidents'[SLA Impact sg]
)


Thanks

Harish KM

If these steps help resolve your issue, your acknowledgment would be greatly appreciated.

v-sshirivolu
Community Support
Community Support

Hi @Victor_Z ,
Thank you for reaching out to Microsoft Fabric community forum.

Create the disconnected slicer table
RootCauseFilter =
DATATABLE(
"FilterOption", STRING,
{
{"Include External Conditions"},
{"Exclude External Conditions"}
}
)

Add the slicer visual
Use - RootCauseFilter[FilterOption] as the field.
User can now choose to Include or Exclude External Conditions

Create the dynamic measure

Dynamic Impact_sg =
VAR SelectedOption = SELECTEDVALUE('RootCauseFilter'[FilterOption], "Include External Conditions")
VAR IsExclude = SelectedOption = "Exclude External Conditions"

RETURN
SUMX(
GROUPBY(
FILTER(
'Table_of_Incidents',
NOT(IsExclude) || 'Table_of_Incidents'[Root Cause] <> "External Conditions"
),
'Table_of_Incidents'[Impacted Service],
'Table_of_Incidents'[Bussiness Process],
'Table_of_Incidents'[SLA Impact sg],
'Table_of_Incidents'[Impact Type],
'Table_of_Incidents'[Affected Panels],
'Table_of_Incidents'[Affected Countries]
),
'Table_of_Incidents'[SLA Impact sg]
)


Add a card or table to show output

Drag in the Dynamic Impact measure.

Select slicer option and watch values update:

Include - Includes all rows.

Exclude - Excludes those with Root Cause = External Conditions.


Please find the attached .pbix file for your reference.

Regards,
Sreeteja.

Thanks a lot. I will try and i´ll back to you with the results. 

Hi @Victor_Z ,
Thank you for the update. If you encounter any issues or need additional assistance, please don't hesitate to reach out. 

I worked thanks a lot. 

rajendraongole1
Super User
Super User

Hi @Victor_Z  - you can create one disconnected table with include and exclude condition as below

 

use calculated table:

ExternalFilterOption = DATATABLE(
"FilterChoice", STRING,
{
{"Include External Conditions"},
{"Exclude External Conditions"}
}
)

 

rajendraongole1_0-1753382904992.png

 

we can add this as slicer to report. ExternalFilterOption[FilterChoice] . 

 

Now create main measure:

Dynamic Impact_sg =
VAR FilterChoice = SELECTEDVALUE('ExternalFilterOption'[FilterChoice], "Include External Conditions")
VAR ApplyFilter = FilterChoice = "Exclude External Conditions"

VAR FilteredTable =
FILTER(
'Table_of_Incidents',
NOT ApplyFilter || 'Table_of_Incidents'[Root Cause] <> "External Conditions"
)

RETURN
SUMX(
GROUPBY(
FilteredTable,
'Table_of_Incidents'[Impacted Service],
'Table_of_Incidents'[Bussiness Process],
'Table_of_Incidents'[SLA Impact sg],
'Table_of_Incidents'[Impact Type],
'Table_of_Incidents'[Affected Panels],
'Table_of_Incidents'[Affected Countries]
),
'Table_of_Incidents'[SLA Impact sg]
)

 

 

This works, please check .





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors