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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
raduchirila
Frequent Visitor

Get value from a slicer when interactions are turned off

For a complex measure, I need to retrieve the selected value from a date slicer that has the interactions turned off with my visual.

Basically, SELTECTEDVALUE would do this, but it seems like this is working only when filtering is active. It returns BLANK once I disabled filtering from Edit Interactions.

 

My measure looks like this:

Variance_Actual_Forecast_Prev_Month =
VAR currentDate=MIN(dim_Calendar[Date])
VAR selectedDate=SELECTEDVALUE(dim_ReportingCalendar[Month Year])  <= this is BLANK
VAR returnVal = IF (MIN(dim_Calendar[Date]) <= [Selected Month / Current Month],
CALCULATE([Actual_USD], FILTER(MonthlyCost, MONTH(MonthlyCost[ReportingDate])=(MONTH(selectedDate)))) -
CALCULATE([Forecast_USD], FILTER(MonthlyCost, MONTH(MonthlyCost[ReportingDate])=(MONTH(currentDate)-1)))) 
RETURN returnVal
 
dim_ReportingCalendar[Month Year]) slicer:
raduchirila_0-1637829368545.png

Is there a way to get the value selected without filtering active?

Many thanks.

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

Hi @raduchirila,

I'm not so sure why you turn off the interactions. The basic interaction logic of power bi visuals is based on the filter effect from the relationship keys. If you turn off the interaction, it means the DAX expression does not recognize/receive any filter effect so its row content is equal to whole table field values.

Change how visuals interact in a report - Power BI | Microsoft Docs
For selectedvalue function itself, it works when only one value exists. Handle multiple values will return blank as result or you can set 'alternate result' option to handle and aggregate these records.

SELECTEDVALUE function - DAX | Microsoft Docs

>>Is there a way to get the value selected without filtering active?

You can create an unconnected parameter table that does not include a relationship to the fact table. For filter and interaction operation, you can use DAX expressions to create a measure filter to achieve them.

Applying a measure filter in Power BI - 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 @raduchirila,

I'm not so sure why you turn off the interactions. The basic interaction logic of power bi visuals is based on the filter effect from the relationship keys. If you turn off the interaction, it means the DAX expression does not recognize/receive any filter effect so its row content is equal to whole table field values.

Change how visuals interact in a report - Power BI | Microsoft Docs
For selectedvalue function itself, it works when only one value exists. Handle multiple values will return blank as result or you can set 'alternate result' option to handle and aggregate these records.

SELECTEDVALUE function - DAX | Microsoft Docs

>>Is there a way to get the value selected without filtering active?

You can create an unconnected parameter table that does not include a relationship to the fact table. For filter and interaction operation, you can use DAX expressions to create a measure filter to achieve them.

Applying a measure filter in Power BI - 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.
VahidDM
Super User
Super User

Hi @raduchirila 

 

Can you please add more details? maybe there is a way to find the desired value with active filter

Is it possible to post a sample data as text and expected output?

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors