cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PietroFarias Regular Visitor
Regular Visitor

Meça para SUM, mas descontando alguns valores antes

I have a measure that performs the sum of a column.

 

Spread: = SUM (DFC [SpreadUnit])

Now, I'd like to do a calculation that I'd like to do in a simplified way, different from what I'm currently doing. The calculation would be to perform the sum of the SpreadUnit column, BUT when the Customer for X column, for example, calculate [SpreadUnit] * (1-0,20), so that it discounts 20% of the value. What is the best way to achieve this result?

 

P.s: I'm using Power Pivot for Excel 2016

1 ACCEPTED SOLUTION

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: Meça para SUM, mas descontando alguns valores antes

Hi @PietroFarias,

 

Please refer to this measure:

Measure 1 :=
IF (
    LASTNONBLANK ( Table2[Customer], 1 ) = "X",
    SUM ( [SpreadUnit] )
        * ( 1 - 0.2 ),
    CALCULATE ( SUM ( [SpreadUnit] ), ALLEXCEPT ( Table2, Table2[Customer] ) )
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
v-yulgu-msft Super Contributor
Super Contributor

Re: Meça para SUM, mas descontando alguns valores antes

Hi @PietroFarias,

 

Please refer to this measure:

Measure 1 :=
IF (
    LASTNONBLANK ( Table2[Customer], 1 ) = "X",
    SUM ( [SpreadUnit] )
        * ( 1 - 0.2 ),
    CALCULATE ( SUM ( [SpreadUnit] ), ALLEXCEPT ( Table2, Table2[Customer] ) )
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

Super User
Super User

Re: Meça para SUM, mas descontando alguns valores antes

Hi,

 

Your question is not clear.  Show a sample dataset and the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 364 members 3,771 guests
Please welcome our newest community members: