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

Measure not affected by month slicer

Hi All,

i want to create set of measures which do not affected by month slicer. Means when i apply month filter, measures "Avg_Q1'21" & "Avg_Q4'19" should not get affected after applying month slicer only and along with that under "Current_MonthSales" it should return the value as per month slicer.

For example:

As per below screenshot (1), when i didn't apply any month filter values of "Avg_Q1'21" & "Avg_Q4'19" are showing but "Current_MonthSales" is blank.

YashR9154_0-1623345807626.png

As per below screenshot (2), when i apply any month filter values of "Avg_Q1'21" & "Avg_Q4'19" are not showing but value of "Current_MonthSales" is showing.

YashR9154_1-1623346456396.png

Solution Required: Once i apply month slicer, values of  "Avg_Q1'21" & "Avg_Q4'19" should not get affected and along with that some values should visible for "Current_MonthSales".

 

Note: I have applied selectedvalue function for "Current_MonthSales" measure.

 

Power BI working file & Raw Data Link: https://drive.google.com/drive/folders/1X1b5AJRLRH5OEjzhanjsO9CjfYcPmDAL?usp=sharing

 

Thanks in advance 🙂

 

 

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @YashR9154,

By default 'selectedvalue' function not handle multiple selections, you need to add the 'alternate Result' expression to handle this.

SELECTEDVALUE function - DAX | Microsoft Docs

Current_MonthSales =
VAR selectedvalue =
    SELECTEDVALUE ( Date_tbl[Month], MAX ( Date_tbl[Month] ) )
RETURN
    CALCULATE ( SUM ( Data[Sales] ), Date_tbl[Month] = selectedvalue )

For the two average measures, I found you add static filters in it so it shows blank when no records matched with current filters.

If you do not want to interact with the current slicer effect, you can add all functions to ignore fitelrs.

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @YashR9154,

By default 'selectedvalue' function not handle multiple selections, you need to add the 'alternate Result' expression to handle this.

SELECTEDVALUE function - DAX | Microsoft Docs

Current_MonthSales =
VAR selectedvalue =
    SELECTEDVALUE ( Date_tbl[Month], MAX ( Date_tbl[Month] ) )
RETURN
    CALCULATE ( SUM ( Data[Sales] ), Date_tbl[Month] = selectedvalue )

For the two average measures, I found you add static filters in it so it shows blank when no records matched with current filters.

If you do not want to interact with the current slicer effect, you can add all functions to ignore fitelrs.

Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

lbendlin
Super User
Super User

Learn about visuals interactions and set yours accordingly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

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