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

measures work well for half of the data but don't return results for other half

Hi, I have a table with expected return of each assets and corresponding volatility as below.

I created some measures with What-if parameters. What-if parameters will let users choose what volatility rate they want and my measures will return the corresponding expected returns.

 

Capture.PNG

 

My problem is my measures work very well for volatility rate : 2,9% -> 3.5%. But from 3.6% they don't generate any result. I don't know what I did wrong here.

 

This is my What-if parameter:

 

Volatility = GENERATESERIES(0.029, 0.046, 0.001)
Volatility Value = SELECTEDVALUE('Volatility'[Volatility], 0.033)

 

here is an example of my measure: 

 

expected return= FORMAT(CALCULATE(MAX(Summary[Expected return]),
ALL(Summary),
FILTER(Summary,Summary[Volatility_rounding]=Volatility[Volatility Value]
))
,"0.00%"
)
 
Please help me with this case.
1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

the way you are using the 'What if'-parameter could/should be replaced with a slicer on your Summary[Volatility]-column. The 'What if'-parameter is meant to be used for calculating changes in a measure based on user input, e.g. what would the total sales be if this discount rate were used. You are using it for a kind of lookup, which should be handled by a normal slicer instead. Then your measure would just be

Expected_return =sum(summary[Expected return])

or possibly like this, if you don't want to show the value unless a slicer value has been chosen

Expected_return =if(hasonevalue([Expected return]);sum(summary[Expected return]);blank())

However, I created a little sample file based on your screenshot, and had the exact same experience. There seems to be something happening to the value created by be 'what if'-parameter which makes just little bit different than the value in your summary table.
Using the round-functions fixed this, so if you want to still use your 'What if'-parameter, you can write is like this

expected return =
CALCULATE (
    MAX ( Summary[Expected return] ),
    FILTER (
        Summary,
        Summary[Volatility_rounding] = ROUND ( Volatility[Volatility Value], 4 )
    )
)

You should drop the formatting part of the measure, use the formatting options in the modelling ribbon instead. Also, as there are no other filters working on your table, there is no need to include the ALL-functions.

 

Cheers,
S

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.