Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Calculate between same field

I have a table, ORIGINAL_TABLE. The table has ROWS and YTD fields. In the table in the field ROWS I have the following records Sales, bonus and salary. I want to create a table in power bi that in addition to these records also have some kpis, in which case the kpis would be bonus / sales and salary / sales. Below we can see how it is and how it would like it to be.

 

ORIGINAL TABLE
ROWSYTD
SALES1.000
BONUS-300
SALARY-400

 

 

NEW TABLE
KPIYTD
SALES                    1.000
BONUS-300
SALARY-400
BONUS / SALES-30%
SALARY / SALES-40%

 

apagar.PNG

 

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

Hi @Anonymous ,

 

We can create calculated table using following DAX to meet your requirement.

 

KPITable = 
UNION (
    'Table2',
    ROW (
        "ROWS", "BONUS/SALES",
        "YTD", DIVIDE (
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "BONUS" ),
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "SALES" )
        )
    ),
    ROW (
        "ROWS", "SALARY/SALES",
        "YTD", DIVIDE (
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "SALARY" ),
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "SALES" )
        )
    )
)

 

18.PNG19.PNG

 

If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

BTW, pbix as attached.

 

Best regards,

 

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

Community Support Team _ Dong Li
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-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create calculated table using following DAX to meet your requirement.

 

KPITable = 
UNION (
    'Table2',
    ROW (
        "ROWS", "BONUS/SALES",
        "YTD", DIVIDE (
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "BONUS" ),
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "SALES" )
        )
    ),
    ROW (
        "ROWS", "SALARY/SALES",
        "YTD", DIVIDE (
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "SALARY" ),
            LOOKUPVALUE ( 'Table2'[YTD], 'Table2'[Rows], "SALES" )
        )
    )
)

 

18.PNG19.PNG

 

If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

BTW, pbix as attached.

 

Best regards,

 

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

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

Hi @Anonymous ,

Not sure what your question is, would you please be more specific?

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.