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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Syndicate_Admin
Administrator
Administrator

Percentage of values by category

Hello everyone

I would like to know if someone can help me with the addition of a card that indicates the percentage of shipments per month as 100%, and go calculating by product category to which percentage corresponds its amount of shipment separately. For example, I have the following table:

CategoryShipmentsmy
Cecinas5.450September
sweets3.240September
cereals1.392August
beverages897July
Meats1.200

July

For this case, if I add a month filter, where I filter by September and I need to show the total shipments of that month on one card, and on another card that shows me the percentage of the total shipments of the month of September or another filtered month (take the case September 5,450 + 3,240 = 8,690 --> 100%), and that later allow me to filter by category in a matrix, and that it indicates to me, for example, the percentage of shipments of sweets (when clicking this category on the matrix) within the total of 100% (percentage of 3,240 within 8,690 ------->37.2%)

Thank you very much in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Syndicate_Admin ,

I have created a simiple sample, please refer to it to see if it helps you.

Create measurs.

Measure =
VAR _1 =
    CALCULATE (
        SUM ( 'Table'[Shipments] ),
        FILTER ( ALL ( 'Table' ), 'Table'[my] = SELECTEDVALUE ( 'Table'[my] ) )
    )
VAR _all =
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[my] = SELECTEDVALUE ( 'Table'[my] )
                && 'Table'[Category] = SELECTEDVALUE ( 'Table'[Category] )
        ),
        'Table'[Shipments]
    )
RETURN
    _all / _1
Measure2 =
VAR _1 =
    CALCULATE (
        SUM ( 'Table'[Shipments] ),
        FILTER ( ALL ( 'Table' ), 'Table'[my] = SELECTEDVALUE ( 'Table'[my] ) )
    )
VAR _all =
    SUMX (
        FILTER ( ALL ( 'Table' ), 'Table'[my] = SELECTEDVALUE ( 'Table'[my] ) ),
        'Table'[Shipments]
    )
RETURN
    _all / _1

 

vpollymsft_0-1667958703799.png

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best Regards

Community Support Team _ Polly

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Syndicate_Admin ,

I have created a simiple sample, please refer to it to see if it helps you.

Create measurs.

Measure =
VAR _1 =
    CALCULATE (
        SUM ( 'Table'[Shipments] ),
        FILTER ( ALL ( 'Table' ), 'Table'[my] = SELECTEDVALUE ( 'Table'[my] ) )
    )
VAR _all =
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[my] = SELECTEDVALUE ( 'Table'[my] )
                && 'Table'[Category] = SELECTEDVALUE ( 'Table'[Category] )
        ),
        'Table'[Shipments]
    )
RETURN
    _all / _1
Measure2 =
VAR _1 =
    CALCULATE (
        SUM ( 'Table'[Shipments] ),
        FILTER ( ALL ( 'Table' ), 'Table'[my] = SELECTEDVALUE ( 'Table'[my] ) )
    )
VAR _all =
    SUMX (
        FILTER ( ALL ( 'Table' ), 'Table'[my] = SELECTEDVALUE ( 'Table'[my] ) ),
        'Table'[Shipments]
    )
RETURN
    _all / _1

 

vpollymsft_0-1667958703799.png

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best Regards

Community Support Team _ Polly

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.