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
Anonymous
Not applicable

How to determine value with what if parameter

Hey Everyone,

 

I saw a hope help online, also with the what if parameters, However I still couldn't get it to work like I hoped. Therefor I hoped someone could help me. 

De data in the dashboeard are refreshed every day. Now some people would like to see the situation at different dates in the past. 

For example, I would like to know how the situation of my data is 2 week ago.

To generate this, I created a what if parameter. There it can selected a date, that needs to visualized. 

Since dates aren't possible, used the dateadd fuction and the last date refresh to calculated the dates for selection.

 

Now I want to  use this selected value (what if parameter) in the data. There I might make a mistake, since it's not working as I hoped yet. IF the selected value is larger than the startdate and smaller than the enddate, than the status was active. I want to determine this for every record. 

I tried :
IF(

SELECTEDVALUE('Par_Date'[SelectedDate]) >= CirkelTable[startdate] && SELECTEDVALUE('Par_Date'[SelectedDate]) < ActiveCirkelTable[EndDate] )

, True(), False()
)

 

Hoewever, I seems like he always returns FALSE. Also if I only place SELECTEDVALUE('Par_Date'[SelectedDate]) >= CirkelTable[startdate]  in the if statement expression, while the dates are smaller. So I know I am doing something wrong. But the selectedvalue does show the date selected.

 

I the end, I would like to see the records whereby my whatif parameter is between the start and end date. Maybe there is a beter method to do this. Could someone help me.

 

Thank you in advance 

 

 

 

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

hi  @Anonymous 

First, for SELECTEDVALUE Function, it returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult.

https://docs.microsoft.com/en-us/dax/selectedvalue-function

Second, for your formula, it seems that it is a calculated column, you should know that:

  1. Calculation column/table not support dynamic changed based on filter or slicer.
  2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

and you should use it in a FILTER of your measure.

 

If you still have the problem, please share your sample pbix file and your expected output. and i will give you further help.

 

Regards,

Lin

Community Support Team _ Lin
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

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

First, for SELECTEDVALUE Function, it returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult.

https://docs.microsoft.com/en-us/dax/selectedvalue-function

Second, for your formula, it seems that it is a calculated column, you should know that:

  1. Calculation column/table not support dynamic changed based on filter or slicer.
  2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.

https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

and you should use it in a FILTER of your measure.

 

If you still have the problem, please share your sample pbix file and your expected output. and i will give you further help.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.