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
li_pham
Frequent Visitor

Total revenue of all sale persons but only for the products belongs to filtered sale person

Hi all,

I have a filter of 1 sale name (example: sale person Sara).

This sale person - Sara have revenue in 3 products: A, B, D. (our list of products have many products as A, B, C, D, E, F...)

I want to calculate total revenue of 3 products: A, B, D (of all sale persons).

So it means that if I change my filter to another sale person, the measure will sum of total revenue of all sale persons but only for the products that belongs to filtered sale person.

Please help to advise me on this case.

Thank you! 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below, and I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1668351242100.png

 

 

Revenue expected measure: =
VAR _productlist =
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS ( ALL ( 'Product'[Product] ), "@rev", [Revenue total:] ),
            [@rev] <> BLANK ()
        ),
        'Product'[Product]
    )
RETURN
    CALCULATE (
        [Revenue total:],
        ALL ( Person[Sales person] ),
        KEEPFILTERS ( 'Product'[Product] IN _productlist )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @li_pham 

Thanks for reaching out to us.

I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

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

CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1668377489519.png

For fun only, a showcase of powerful Excel worksheet formulas

CNENFRNL_1-1668377655766.gif

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below, and I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1668351242100.png

 

 

Revenue expected measure: =
VAR _productlist =
    SUMMARIZE (
        FILTER (
            ADDCOLUMNS ( ALL ( 'Product'[Product] ), "@rev", [Revenue total:] ),
            [@rev] <> BLANK ()
        ),
        'Product'[Product]
    )
RETURN
    CALCULATE (
        [Revenue total:],
        ALL ( Person[Sales person] ),
        KEEPFILTERS ( 'Product'[Product] IN _productlist )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.

Top Solution Authors