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

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.

 

Revenue VS Target = Revenue / Target (in percentage)

Simulation Formula:

Unit Price Scenario = is a number from -1 to 1, increased by 0.5 use generate series function to create this using parameter in the modeling tab. This will be used in a filter to select price as below:

Revenue Scenario = Quantity of Items * (1 + Unit Price Scenario Value) * Unit Price

Revenue Scenario VS Target = Revenue Scenario / Target

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

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:

1.png

Target:

2.png

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.

2.png

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.

 

View solution in original post

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

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:

1.png

Target:

2.png

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.

2.png

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.

 

amitchandak
Super User
Super User

@Anonymous , Not very clear. You need what if for Unit Price Scenario, what is issues all measures some wring values ?

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.

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.