Forum Discussion

UBComma's avatar
UBComma
Icon for Helper III rankHelper III
4 years ago
Solved

Calculated Column won't take value from Parameter Slicer

I have been staring at this for hours and can't figure out what I'm doing wrong. I created a simple test PBI file to demonstrate the issue I'm having with my model. I'm trying to do a calculation of Future Value where the amount of the Present Value is influenced by a parameter slicer. The calculated table looks like this:

 

 

 

Test Table = 
    ADDCOLUMNS(
        Years,
        "Calculated Value",
            FV(.5,Years[Year] - MIN( Years[Year]),1,-[Test1])
            )

 

 

 

The Measure [Test1] is a simple calculation: 

Test1 =
DIVIDE ( 100, [Denominator Value] )
 
and the Denominator value is set by a parameter slider with numbers 1-20 and the auto-created parameter measure that reads:
Denominator Value =
SELECTEDVALUE ( 'Denominator'[Denominator], 2 )
 
I am referencing a Years table in the table created above, that is also a simple table created this way:
Years = GENERATESERIES(2022, 2022+15, 1)
 
When I create any visualization, for example a line chart, the visualization calculated based on the alternate value of the parameter measure ("2" shown above) and will not change if I adjust the parameter slider.
 
Any thoughts on why this isn't working and how to fix it? I will be happy to upload my test PBIX file if that helps.
 
 
 


  • UBComma,

     

    Calculated columns and calculated tables don't recognize user selections in report visuals. Try rewriting the DAX as a measure:

     

    Calculated Value = 
    VAR vMinYear =
        CALCULATE ( MIN ( Years[Year] ), ALL ( Years[Year] ) )
    VAR vCurrentYear =
        MAX ( Years[Year] )
    VAR vResult =
        FV ( .5, vCurrentYear - vMinYear, 1, DIVIDE ( 100, - [Denominator Value] ) )
    RETURN
        vResult

     

     

1 Reply

  • UBComma,

     

    Calculated columns and calculated tables don't recognize user selections in report visuals. Try rewriting the DAX as a measure:

     

    Calculated Value = 
    VAR vMinYear =
        CALCULATE ( MIN ( Years[Year] ), ALL ( Years[Year] ) )
    VAR vCurrentYear =
        MAX ( Years[Year] )
    VAR vResult =
        FV ( .5, vCurrentYear - vMinYear, 1, DIVIDE ( 100, - [Denominator Value] ) )
    RETURN
        vResult