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
rajibmahmud
Helper III
Helper III

SUMIFS in BI

I am trying to do a sumifs in BI table. In excel, it can done using 

SUMIFS(E:E,D: D,Table1[@Product],B:B,Table1[@Period],A:A,Table1[@Year]-1).

What I am trying to do is to calculate PY Sales value from below table where I have both 2016 & 2017. My target is to get PY Value in a calculated column for 2017 and 2016, it can be expressed in zero.

 

YearPeriodVersionProductCY Sales
2016JanActualIce Cream110
2016FebActualIce Cream101
2016MarActualIce Cream167
2016AprActualIce Cream141
2016MayActualIce Cream146
2016JanActualCake126
2016FebActualCake139
2016MarActualCake103
2016AprActualCake117
2016MayActualCake124
2017JanActualIce Cream136
2017FebActualIce Cream113
2017MarActualIce Cream101
2017AprActualIce Cream130
2017MayActualIce Cream173
2017JanActualCake164
2017FebActualCake181
2017MarActualCake192
2017AprActualCake187
2017MayActualCake150

 

 

2 ACCEPTED SOLUTIONS
v-huizhn-msft
Employee
Employee

Hi @rajibmahmud

Please use LOOKUP function, you can use mutiple conditions <search_columnName>, <search_value> like the criteria_range1, criteria1 in SUMIFS function.

Create a calculated column using the formula. And see the expected result shown in the screenshot below.

Column = LOOKUPVALUE(Table1[CY Sales],Table1[Product],Table1[Product],Table1[Period],Table1[Period],Table1[Year],Table1[Year]-1)


1.PNG

Best Regards,
Angelia

View solution in original post

Hi @rajibmahmud,

Please create a new table by clicking "New Table" under Modeling on home page using the formula. Please learn more about SUMMARIZE from here.

NewTable=summarize(Table,Table[Period],Table[Version],Table[Product],"CY Sales",SUM(Table[CYSales]))


Then you will get single product in single month. Then create the calclated column using the formula above based on the new table.

Best Regards,
Angelia

View solution in original post

3 REPLIES 3
v-huizhn-msft
Employee
Employee

Hi @rajibmahmud

Please use LOOKUP function, you can use mutiple conditions <search_columnName>, <search_value> like the criteria_range1, criteria1 in SUMIFS function.

Create a calculated column using the formula. And see the expected result shown in the screenshot below.

Column = LOOKUPVALUE(Table1[CY Sales],Table1[Product],Table1[Product],Table1[Period],Table1[Period],Table1[Year],Table1[Year]-1)


1.PNG

Best Regards,
Angelia

@v-huizhn-msft

Thanks a lot.

 

Will it do sumifs or lookup? In case of multiple value for single Product in a single month, will it work?

 

Example:

YearPeriodVersionProductCY Sales
2016JanActualIce Cream110
2016JanActualIce Cream101
2016JanActualIce Cream167
2016AprActualIce Cream141
2016MayActualIce Cream146

Hi @rajibmahmud,

Please create a new table by clicking "New Table" under Modeling on home page using the formula. Please learn more about SUMMARIZE from here.

NewTable=summarize(Table,Table[Period],Table[Version],Table[Product],"CY Sales",SUM(Table[CYSales]))


Then you will get single product in single month. Then create the calclated column using the formula above based on the new table.

Best Regards,
Angelia

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.