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
alexbalazsalex
Helper IV
Helper IV

Percentage of total filtered.

Dear All,

 

I would need your support with the following formula :

 

Weight in % = CALCULATE(CALCULATE(sum('Orders -  Accum'[Value]),'Incoming Orders -  Accum'[Attribute]="Requested Tons"),FILTER('Orders -  Accum','Orders -  Accum'[Month]=[Month Under Analysis]))/CALCULATE(CALCULATE(sum('Orders -  Accum'[Value]),'Incoming Orders -  Accum'[Attribute]="Requested Tons"),FILTER(ALL('Orders -  Accum'),'Orders -  Accum'[Month]=[Month Under Analysis]))

 

Basically it calculates the weight of each product by total month ..

 

Is there a way to make the calculation dividing each product by not only month by every  filter applied ?

 

Let me know if any ideas..

 

Thanks a lot

Alex

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

try with ALLSELECTED

Weight in % =
CALCULATE (
    CALCULATE (
        SUM ( 'Orders -  Accum'[Value] ),
        'Incoming Orders -  Accum'[Attribute] = "Requested Tons"
    ),
    FILTER ( 'Orders -  Accum', 'Orders -  Accum'[Month] = [Month Under Analysis] )
)
    / CALCULATE (
        CALCULATE (
            SUM ( 'Orders -  Accum'[Value] ),
            'Incoming Orders -  Accum'[Attribute] = "Requested Tons"
        ),
        FILTER (
            ALLSELECTED ( 'Orders -  Accum' ),
            'Orders -  Accum'[Month] = [Month Under Analysis]
        )
    )


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @alexbalazsalex,

 

Have you solved your problem?

 

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please share some data sample which could reproducec your scenario and your desired output so that we could help further on it.

 

Best Regards,

Cherry

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

try with ALLSELECTED

Weight in % =
CALCULATE (
    CALCULATE (
        SUM ( 'Orders -  Accum'[Value] ),
        'Incoming Orders -  Accum'[Attribute] = "Requested Tons"
    ),
    FILTER ( 'Orders -  Accum', 'Orders -  Accum'[Month] = [Month Under Analysis] )
)
    / CALCULATE (
        CALCULATE (
            SUM ( 'Orders -  Accum'[Value] ),
            'Incoming Orders -  Accum'[Attribute] = "Requested Tons"
        ),
        FILTER (
            ALLSELECTED ( 'Orders -  Accum' ),
            'Orders -  Accum'[Month] = [Month Under Analysis]
        )
    )


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

It seems to be weorking thanks a lot !

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.