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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate a percentage, based on separate rows

Hello community.

 

I need some help with creating a percentage based on buttom of a table and the top.

tobkres_0-1655794376568.png

I need it to take the 86.160,69 (Dækningsbidrag) and divide it by 95.038,00 (Omsætning) and shown as a percentage beside the number 86.160,69. 

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please try this code. Please adjust the spilling of the words.

Bel∅b Measure =
VAR NormalValue =
    SUM ( TableName[Bel∅b] )
VAR OmstaetningValue =
    CALCULATE (
        SUM ( TableName[Bel∅b] ),
        TableName[N∅glital DKK] = "OmstaetningValue"
    )
RETURN
    IF (
        HASONEVALUE ( TableName[N∅glital DKK] ),
        NormalValue,
        NormalValue & " ("
            & FORMAT ( DIVIDE ( NormalValue, OmstaetningValue ), "Percent" ) & ")"
    )

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Thank you for helping me out. I have tried, but i get the following error.

Column 'Inversbeloeb' in table 'MeasureTable' cannot be found or may not be used in this expression.

 

This is the code: 

DG percentage = 
VAR NormalValue =
    SUM ( MeasureTable[Inversbeloeb] )
VAR RevenueValue =
    CALCULATE(
        SUM ( MeasureTable[Inversbeloeb] ),
        Sortorder[KontoOverskrift] = "RevenueValue"
    )
RETURN
    IF (
        HASONEVALUE ( Sortorder[KontoOverskrift] ),
        NormalValue,
        NormalValue & " ("
            & FORMAT ( DIVIDE ( NormalValue, RevenueValue ), "Percent" ) & ")" 

 

These are the fields.

tobkres_0-1655800294179.png

 

Have i missed something?

@Anonymous 
Please try

DG percentage =
VAR NormalValue = [Inversbeloeb]
VAR RevenueValue =
    CALCULATE ( [Inversbeloeb], Sortorder[KontoOverskrift] = "RevenueValue" )
RETURN
    IF (
        HASONEVALUE ( Sortorder[KontoOverskrift] ),
        NormalValue,
        NormalValue & " ("
            & FORMAT ( DIVIDE ( NormalValue, RevenueValue ), "Percent" ) & ")"
    )
Anonymous
Not applicable

Seems like it just returns the same numbers.

tobkres_1-1655804228635.png

 

 

 

@Anonymous 
Please make sure you are using the correct spilling. Copy the name from inside the column. If you want we can connect via zoom. Will take only 10min to sort it out.

tamerj1
Super User
Super User

Hi @Anonymous 
Please try this code. Please adjust the spilling of the words.

Bel∅b Measure =
VAR NormalValue =
    SUM ( TableName[Bel∅b] )
VAR OmstaetningValue =
    CALCULATE (
        SUM ( TableName[Bel∅b] ),
        TableName[N∅glital DKK] = "OmstaetningValue"
    )
RETURN
    IF (
        HASONEVALUE ( TableName[N∅glital DKK] ),
        NormalValue,
        NormalValue & " ("
            & FORMAT ( DIVIDE ( NormalValue, OmstaetningValue ), "Percent" ) & ")"
    )

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.