Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create Revenue vs Target

Hi Team, i have revenue and target are two different fields based on that i want to create below dax functions, can you please help me to create below dax and both tables dont have relationship.   ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous 

    According to your statement, I think "Unit Price Scenario" is created by What if parameter option. Here I create a sample to have a test.

    Revenue:

    Target:

    There is no relationship between two tables.

    Measure:

    Revenue Scenario VS Target = 
    VAR _Unit_Price_Scenario_Value =
        SELECTEDVALUE ( 'Unit Price Scenario'[Unit Price Scenario] )
    VAR _Revenue_Scenario =
        SUM ( Revenue[Quantity of Items] ) * ( 1 + _Unit_Price_Scenario_Value )
            * SUM ( Revenue[Unit Price] )
    VAR _Target =
        CALCULATE (
            SUM ( Target[Target] ),
            FILTER ( ALL ( Target ), Target[Category] = MAX ( Revenue[Category] ) )
        )
    RETURN
        DIVIDE ( _Revenue_Scenario, _Target )

    Result is as below.

    Best Regards,
    Rico Zhou

     

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