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

Calculating percentages of subtotals

Hello!

I will first disclose that I am an occasional Power BI user, please excuse me if some necessary details are lacking, I will gladly provide whatever may be missing.

Sheet1:

Tested byAccountBalance sheet itemValue
AGeleistete AnzahlungenAdvance payments on inventories150
BVerrechnung geleisteAdvance payments on inventories130
AForderungen InlandTrade accounts receivable400
AForderungen AuslandTrade accounts receivable350
AKorrekturkonto BewertungTrade accounts receivable820
CUmgliederung kred. DebitorenTrade accounts receivable120
BUmgliederung kred. DebitorenTrade accounts receivable30
DForderungen an deb. KreditorOther current assets70
DForderungen an deb. KreditorOther current assets50

To the point:

I would like to create a dashboard consisting of the following models:  A slicer which with the option to choose a tester (A/B/C/D) and a bar chart, representing each balance sheet item on the x-axis with percentage points on the y-axis (can also be a table).

For example, if tester A were to be chosen, the chart (or table) should display: 

-Advance payments on inventories: 53%

-Trade accounts receivable: 91%

-Other current assets: 0%

This should translate into how much each subtotal of each specific balance sheet item was reviewed by the selected tester.

I have tried to create a new column using the following DAX command "divide((Sheet1[Value],sum(Sheet1[Value])*100)" which didn't result in much of use, as it uses the overall total value to calculate a percentage. I also have tried to apply similar solutions from previous posts, although non with much success.

Any input will be greatly appreciated 🙂

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

Hi @Anonymous ,

 

You may try these measures.

Advance payments on inventories = 
VAR TT =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Balance sheet item] = "Advance payments on inventories"
        )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Tested by] ),
        "A",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "A"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            ),
        "B",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "B"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            ),
        "C",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "C"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            ),
        "D",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "D"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            )
    )
Other current assets = 
VAR TT =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Balance sheet item] = "Other current assets"
        )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Tested by] ),
        "A",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "A"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            ),
        "B",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "B"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            ),
        "C",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "C"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            ),
        "D",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "D"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            )
    )
Trade accounts receivable = 
VAR TT =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Balance sheet item] = "Trade accounts receivable"
        )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Tested by] ),
        "A",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "A"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            ),
        "B",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "B"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            ),
        "C",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "C"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            ),
        "D",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "D"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            )
    )

 

If A is chosen, the chart is as follows.

1.png

 

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You may try these measures.

Advance payments on inventories = 
VAR TT =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Balance sheet item] = "Advance payments on inventories"
        )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Tested by] ),
        "A",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "A"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            ),
        "B",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "B"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            ),
        "C",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "C"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            ),
        "D",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "D"
                            && [Balance sheet item] = "Advance payments on inventories"
                    )
                ),
                TT
            )
    )
Other current assets = 
VAR TT =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Balance sheet item] = "Other current assets"
        )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Tested by] ),
        "A",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "A"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            ),
        "B",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "B"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            ),
        "C",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "C"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            ),
        "D",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "D"
                            && [Balance sheet item] = "Other current assets"
                    )
                ),
                TT
            )
    )
Trade accounts receivable = 
VAR TT =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Balance sheet item] = "Trade accounts receivable"
        )
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( 'Table'[Tested by] ),
        "A",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "A"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            ),
        "B",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "B"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            ),
        "C",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "C"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            ),
        "D",
            DIVIDE (
                CALCULATE (
                    SUM ( 'Table'[Value] ),
                    FILTER (
                        'Table',
                        [Tested by] = "D"
                            && [Balance sheet item] = "Trade accounts receivable"
                    )
                ),
                TT
            )
    )

 

If A is chosen, the chart is as follows.

1.png

 

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

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 applicable

Hi @amitchandak thank you for the response.

The basis of percentage should be the total value of each balance sheet item by itself.

For example, it is 280 in the case of "Advance payment inventories" and 1720 in "Trade accounts receiveables".

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.