cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Filter to always show one value irrespective of the filter selection

 

Hi 

 

Is it possible to have the visual always to show 2019 regardless of filter Selection?

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Filter to always show one value irrespective of the filter selection

Hi @carlol ,

Please try to change the type of X-axis from continuous to categorical, it should work.

x-axis.png

 

Best Regards,
Yingjie Li

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

View solution in original post

9 REPLIES 9
Highlighted
Super User IV
Super User IV

Re: Filter to always show one value irrespective of the filter selection

@carlol ,

Better to have separate Year table for this

 

measure =
var _Sel = union(allselected(Year[Year]),row("Year",2009))
return
calculate([measure] , filter(all(Year), Year[Year] in _sel))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper II
Helper II

Re: Filter to always show one value irrespective of the filter selection

measure = var _Sel = union(allselected('IHFD vwKPI'[Year]),row("Year",2009))
return
calculate('IHFD vwKPI'[Average], filter(all('IHFD vwKPI'[Year]),'IHFD vwKPI'[Year] in _Sel))
 
I select 2017 , Average of 2017 is only illustrated , am I doing something wrong?
Highlighted
Helper II
Helper II

Re: Filter to always show one value irrespective of the filter selection

Few Attempts , struggling

 

I want it to include the filter selection and 9999

 

measure =
var _Sel = union(allselected(('IHFD DimHospital'[HospID]),row("HospID" ,9999))
return
calculate('IHFD vwKPI'[Average] , filter(all('IHFD DimHospital'), 'IHFD DimHospital'[HospID] in _sel))
 
measure =
VAR _Sel = SELECTEDVALUE ('IHFD DimHospital'[Hospital])
VAR _Table = CALCULATETABLE ( VALUES ('IHFD DimHospital'[HospID]),'IHFD DimHospital'[Hospital] = _Sel)
RETURN
CALCULATE ('IHFD vwKPI'[%] ,FILTER(ALL(_Table),'IHFD DimHospital'[HospID] in _Sel))
 
measure =
VAR _Sel = SELECTEDVALUE ('IHFD DimHospital'[Hospital])
VAR _Table = CALCULATETABLE ( VALUES ('IHFD DimHospital'[HospID]),'IHFD DimHospital'[Hospital] = _Sel)
RETURN
CALCULATE ('IHFD vwKPI'[%] ,_Table, KEEPFILTERS ('IHFD DimHospital'[HospID]= "9999" || 'IHFD DimHospital'[Hospital] = _Sel ))
 
Highlighted
Community Support
Community Support

Re: Filter to always show one value irrespective of the filter selection

Hi @carlol ,

You can create a seprate year table and create this measure:

 

Year = DISTINCT('Table'[Year])
Measure =
IF (
    SELECTEDVALUE ( 'Table'[Year] ) = 2019,
    SUM ( 'Table'[Value] ),
    IF (
        SELECTEDVALUE ( 'Table'[Year] ) IN DISTINCT ( 'Year'[Year] ),
        SUM ( 'Table'[Value] )
    )
)

 

slicer.png

Attached a sample file in the below that you can refer, hopes to help you.

 

Best Regards,
Yingjie Li

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

Highlighted
Helper II
Helper II

Re: Filter to always show one value irrespective of the filter selection

Thanks

 

But that is not what I want 

If a User Selects 2009 in the Slicer , I want to illustrate 2009 and 2010 Data Only

If a User Selects 2008 in the Slicer , I want to illustrate 2008 and 2010 Data Only

 

Ideally the Year table should be 

 

Year =

Union(ALLSELECTED('Year'[Year]),ROW("Year","2010")) but based on  SELECTEDVALUE ('Year'[Year])

 

 

This Should work

 

VAR _Sel = Union(ALLSELECTED('IHFD vwKPI'[HospID]),ROW("HospID","9999"))
Return
CALCULATE(Round(Divide(SUM('IHFD vwKPI'[Numerator]),SUM('IHFD vwKPI'[Denominator])),2),FILTER(ALL('IHFD vwKPI'),'IHFD vwKPI'[HospID] in _Sel)
)
Highlighted
Community Support
Community Support

Re: Filter to always show one value irrespective of the filter selection

Hi @carlol ,

"If a User Selects 2009 in the Slicer , I want to illustrate 2009 and 2010 Data Only

If a User Selects 2008 in the Slicer , I want to illustrate 2008 and 2010 Data Only"

 

In the sample, you can set the slicer selection as single in the selction controls to only selcet one year value.

year slicer.png

 

Best Regards,
Yingjie Li

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

Highlighted
Helper II
Helper II

Re: Filter to always show one value irrespective of the filter selection

 

If a User Selects 2016 in the Slicer ,  it illustrates 2016,2017,2018,2019

If a User Selects 2017 in the Slicer ,  it illustrates 2017,2018,2019

 

If as user selects 2016 , you cannot have 2017 illustrating zero , if a user selects 2017 , 20 is illustrated 

 

The X axis needs to just illustrate the data points Selected ,

 

If a User Selects 2016 in the Slicer ,

2016 and 2019 is only illustrated

 

If a User Selects 2017 in the Slicer ,

2017 and 2019 is only illustrated

 

 

Highlighted
Community Support
Community Support

Re: Filter to always show one value irrespective of the filter selection

Hi @carlol ,

Please try to change the type of X-axis from continuous to categorical, it should work.

x-axis.png

 

Best Regards,
Yingjie Li

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

View solution in original post

Highlighted
Helper II
Helper II

Re: Filter to always show one value irrespective of the filter selection

Thanks Yingjie Li, was not aware of that feature 

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors