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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
robdan
Regular Visitor

Help me build a SUMIF funtion in powerBI

I would need to replicate, in a new column, a very simple SUMIF function. I've tried for hours, but i'm unable to complete this task in PowerBI.

My database (DB_CORP) has, for each observation a single client name and 3 columns: "CUSTOMER" (the customer name); "GROUP" (the holding name of the customer, multiple customers can have the same GROUP name); "REVENUE" 

Below a screenshot of the new column formula I need to replicate. If a Group's revenues are negative, put a "Y" for each customer part of that group, and viceversa.

 

Capture.JPGve

1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

hi, @robdan 

 try below for column

Column = 
var a = SUMX( FILTER('Table','Table'[group]=EARLIER('Table'[group])),'Table'[revenur])
return
IF(a<0,"y","n")

 

 

Dangar332_0-1704997424199.png

 

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @robdan 

for a calculated column, you may try

Group Revenue =
IF (
SUMX (
CALCULATETABLE ( ALLEXCEPT ( 'Table', 'Table'[Group] ) ),
'Table'[Revenue]
) >= 0,
"N",
"Y"
)

Dangar332
Super User
Super User

hi, @robdan 

 try below for column

Column = 
var a = SUMX( FILTER('Table','Table'[group]=EARLIER('Table'[group])),'Table'[revenur])
return
IF(a<0,"y","n")

 

 

Dangar332_0-1704997424199.png

 

who knew that asking on the internet would have saved me a couple of hours! thanks a lot it works very well, unfortunately i'm not familiar with DAX

Hi, @robdan 

 

Asking on internet is easy

But it valueble when you shake your mind and still not get answer.

you learn new things and gain knowledge from your efforts.

 

Enjoy your day 😊

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors