cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GopVan
Frequent Visitor

Add values while keeping Selected Slicer Value

Sample File with data is as below:

PBIX File

 

I have 2 tables:

 

1. Calendar table that has dates between 2022 - 2025

2. Events Table that has Event, Role, Department, Start date, End Date

 

Start Date has a relationship to the date in the Calendar table i.e. each date in the Calendar may have one or more events that start on a date.

 

I have 5 slicers: Role, Department on the Events and Year, Month, and Quarter on the Calendar table. Only one year can be chosen. But multiple positions and departments can be chosen.

 

I have a particular department, whose data needs to be shown irrespective of what role and department are chosen on the slicer.

 

The Measure calculation in the Events table is as follows:

 

 

MeasureEventPeriod =

VAR Startdt = CALCULATE(MIN(Events[StartDate]), REMOVEFILTERS('Calendar'))

VAR Enddt = CALCULATE(MIN(Events[EndDate]), REMOVEFILTERS('Calendar'))

VAR EventPeriod = MIN('Calendar'[Date])>=Startdt && MIN('Calendar'[Date])<= Enddt

VAR Result = IF(EventPeriod, 1)

Return Result

 

 

 

If the slicer selected Department = A, I want to show Department A & Z 

If the slicer selected Department = B, I want to show Department B & Z 

If the slicer selected Department = A & B, I want to show Department A & B & Z 

If the slicer selected Department = Z, I want to show only Z 

 

Or the other option is to not show Z in the slicer but include them in the visual. Visual is a matrix with Department and Role as rows and Months and Weeks as Columns.

 

Since the measure only involves Calendar, I am not sure how to filter and show rows belonging to specific Department

Sample File with data is as below:

PBIX FIle Link

2 REPLIES 2
v-jialluo-msft
Community Support
Community Support

Hi  @GopVan ,

 

According to your description, you need to default to display Z department and other departments selected by the slicer when the slicer does not select Z department.
But this may not be possible, depending on how the slicer works, you need to select the Z department normally to display properly

 

Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Is it possible to manipulate the select values to include the default department? 

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors