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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KuntalSingh
Helper V
Helper V

Need Help on sumif & Countif

Hi All I have mention below data.

Need to apply  formula to get the data.

Concatenate Reference and ABS(Amount doc currency) in input sheet - Copy and Paste special in a new sheet.
Apply sumif formula with Amount in doc currency based on Concatenate Value
Apply Countif formula with Amount in doc currency based on Concatenate Value
Countif MR8M text in the column Text
Filter 3 in CountIF  and MR8M more than 1 - highlight as less priority
Filter even Number and MR8M 0 and sum 0 - Highlight as less priority and provide comment as F-44 Clearing

 

ReferenceAmountindoccurrConcatenateSumCountIFMR8M
000000079314-2200000000007931422000-2200031
0000000793142200000000007931422000-2200031
000000079314-2200000000007931422000-2200031
000000080007CO-7500000000080007CO7500-750010
0000009-150000000091500-150010
0000035-7500000035750-75010
0000053314-250000000533142500-250010
0000053475-2250000053475225-22510
0000068-6100000068610-61010
0000103-5800000103580-58010
0000111702-7800000111702780-78010
00001166100-138239.7900001166100138239.79-13824010
00001167721-138239.7900001167721138239.79-13824010
0000131000000001310000020
0000143884-7339.500001438847339.5-7339.510
0000154-750000001547500-750031
0000154750000001547500-750031
0000154-750000001547500-750031
00001A-1000000001A10000-1000010
0000357140-6491.5200003571406491.52-6491.5210
0000357818-5091.6600003578185091.66-5091.6610
0000358656-6843.200003586566843.2-6843.210
0000358864-6843.200003588646843.2-6843.210
0000358924-2217.9800003589242217.98-2217.9810
0000358947-2216.3400003589472216.34-2216.3410
0000358949-2417.5200003589492417.52-2417.5210
0000358952-7623.2800003589527623.28-7623.2810
0000358953-15024.24000035895315024.24-15024.210
0000358997-2417.9200003589972417.92-2417.9210
0000359027-1977.8600003590271977.86-1977.8610
0000359050-2441.1200003590502441.12-2441.1210
0000359210-1365.8400003592101365.84-1365.8410
0000359210-1905.8200003592101905.82-1905.8210
0000359210-3706.2400003592103706.24-3706.2410
0000359210-4902.7800003592104902.78-4902.7810
0000359217-1365.8400003592171365.84-1365.8410
0000359217-2115.3600003592172115.36-2115.3610
0000359729-1981.5100003597291981.51-1981.5110
0000359746-1977.8600003597461977.86-3955.7220
0000359746-1977.8600003597461977.86-3955.7220
0000359746-4902.7800003597464902.78-4902.7810
0000359751-3903.7400003597513903.74-3903.7410
0000359783-7623.2800003597837623.28-7623.2810
0000359804-2417.5200003598042417.52-2417.5210
0000359805-2417.5200003598052417.52-2417.5210
0000359807-4902.7800003598074902.78-4902.7810
0000359807-5755.3400003598075755.34-5755.3410
0000359827-2155.0100003598272155.01-2155.0110
0000359830-2417.5200003598302417.52-2417.5210
0000359839-4435.9800003598394435.98-4435.9810
0000359841-2417.5200003598412417.52-2417.5210
0000359842-2217.9800003598422217.98-4435.9620
0000359842-2217.9800003598422217.98-4435.9620
0000359883-4435.9800003598834435.98-4435.9810
0000359909-2597.0600003599092597.06-2597.0610
0000359939-1494.7200003599391494.72-1494.7210
0000359942-2216.3400003599422216.34-2216.3410
0000359944-5234.6900003599445234.69-10469.420
0000359944-15585.8000035994415585.8-46757.430
0000359944-5234.6900003599445234.69-10469.420
0000359944-15585.8000035994415585.8-46757.430
0000359944-15585.8000035994415585.8-46757.430
0000359977-15585.8000035997715585.8-15585.810
0000360003-3577.6400003600033577.64-7155.2820
0000360003-2551.4300003600032551.43-7654.2930
000080052658-23782.6200008005265823782.62-23782.610
000080169978-5559.350000801699785559.35-5559.3510
000080219852-23782.6200008021985223782.62-23782.610
000080220447-6710.180000802204476710.18-6710.1810
000080317998-5765.010000803179985765.01-5765.0110
000080323215-36866.6600008032321536866.66-36866.710
000080400574-23782.6200008040057423782.62-23782.610
000080556495-23782.6200008055649523782.62-23782.610
000080661862-36866.6600008066186236866.66-36866.710
000080661870-36866.6600008066187036866.66-36866.710
000080661908-36866.6600008066190836866.66-36866.710
000080746270-36866.6600008074627036866.66-36866.710
000080746319-36866.6600008074631936866.66-36866.710
000080746369-36866.6600008074636936866.66-36866.710
000080746548-36866.6600008074654836866.66-36866.710
000080746597-36866.6600008074659736866.66-36866.710
000080807757-23782.6200008080775723782.62-23782.610
000080860392-7382.50000808603927382.5-7382.510
000081033565-23782.6200008103356523782.62-23782.610
000081033998-23782.6200008103399823782.62-23782.610
000081034251-23782.6200008103425123782.62-23782.610
000081034359-23782.6200008103435923782.62-23782.610
000081037536-36866.6600008103753636866.66-36866.710
000081090212-6544.560000810902126544.56-6544.5610
000081154275-36866.6600008115427536866.66-36866.710
000081228935-23782.6200008122893523782.62-23782.610
000081544261-23782.6200008154426123782.62-23782.610
000081575694-23782.6200008157569423782.62-23782.610
000081708242-3557.610000817082423557.61-3557.6110
000081740534-36866.6600008174053436866.66-36866.710
000081764801-23782.6200008176480123782.62-23782.610
000081764981-23782.6200008176498123782.62-23782.610
000081765214-28308.0600008176521428308.06-28308.110
000081765527-4027.840000817655274027.84-4027.8410
000081769705-36866.6600008176970536866.66-36866.710
000081769732-36866.6600008176973236866.66-36866.710
000081789245-24285.7500008178924524285.75-24285.810
000081860714-36866.6600008186071436866.66-36866.710
000081860724-36866.6600008186072436866.66-36866.710
000081909702-23782.6200008190970223782.62-23782.610
000081909862-14669.8900008190986214669.89-14669.910
000081910259-23782.6200008191025923782.62-23782.610
000081936518-36866.6600008193651836866.66-36866.710
000081959029-24285.7500008195902924285.75-24285.810
000082069809-3557.610000820698093557.61-3557.6110
000082069810-3557.610000820698103557.61-3557.6110
000082069813-3557.610000820698133557.61-3557.6110
000082069918-3177.890000820699183177.89-3177.8910
000082069921-3177.890000820699213177.89-3177.8910
000082069924-3177.890000820699243177.89-3177.8910
000082124391-23782.6200008212439123782.62-23782.610
000082129754-36866.6600008212975436866.66-36866.710
000082155009-3177.890000821550093177.89-3177.8910
000082237596-23782.6200008223759623782.62-23782.610
000082237619-14669.8900008223761914669.89-14669.910
000082237659-14669.8900008223765914669.89-14669.910
000082263438-36866.6600008226343836866.66-36866.710
000082263440-36866.6600008226344036866.66-36866.710
000082274976-36866.6600008227497636866.66-36866.710
000082275056-23782.6200008227505623782.62-23782.610
000082400188-4695.730000824001884695.73-4695.7310
000082426591-36866.6600008242659136866.66-36866.710
000082427476-13542.8800008242747613542.88-13542.910
000082454098-3177.890000824540983177.89-3177.8910
000082454108-3177.890000824541083177.89-3177.8910
000082454110-14669.8900008245411014669.89-14669.910
000082454148-36866.6600008245414836866.66-36866.710
000082474871-33024.6800008247487133024.68-33024.710
000082475444-9524.050000824754449524.05-9524.0510
000082484424-3177.890000824844243177.89-3177.8910
000082484870-5107.110000824848705107.11-5107.1110
000082484876-4408.540000824848764408.54-4408.5410
000082484886-4408.540000824848864408.54-4408.5410
000082484894-5223.380000824848945223.38-5223.3810
000082485079-4408.540000824850794408.54-4408.5410
000082485207-940.25000082485207940.25-940.2510
000082530541-5164.90000825305415164.9-5164.910
000082530981-4695.730000825309814695.73-4695.7310
000082531004-5784.550000825310045784.55-5784.5510
000082531016-4695.730000825310164695.73-4695.7310
000082531017-5016.530000825310175016.53-5016.5310
000082531045-5304.830000825310455304.83-5304.8310
000082531099-5376.610000825310995376.61-5376.6110
000082531150-4027.840000825311504027.84-4027.8410
000082531216-28308.0600008253121628308.06-28308.110
000082536356-33024.6800008253635633024.68-33024.710
000082555185-2650.410000825551852650.41-2650.4110
000082555727-6679.640000825557276679.64-6679.6410
000082576746-8581.620000825767468581.62-8581.6210
000082576903-5107.110000825769035107.11-5107.1110
000082576908-4408.540000825769084408.54-8817.0820
000082576908-4408.540000825769084408.54-8817.0820
000082576910-4408.540000825769104408.54-8817.0820
1 ACCEPTED SOLUTION

@KuntalSingh, go ahead and try it, and if you hit any snags, just reach out.

 in power query, create a new column

 

= Table.AddColumn(YourTableName, "ConcatenatedColumn", each [A] & Number.ToText(Number.Abs([B])))

 

SUMIF:

 

let
    GroupedTable = Table.Group(YourTableName, {"C"}, {{"SumColumn", each List.Sum([B]), type number}}),
    MergedTable = Table.NestedJoin(YourTableName, {"C"}, GroupedTable, {"C"}, "MergedColumn", JoinKind.LeftOuter),
    ExpandedTable = Table.ExpandTableColumn(MergedTable, "MergedColumn", {"SumColumn"}, {"SumColumn"})
in
    ExpandedTable

 

COUNTIF:

 

let
    GroupedTable = Table.Group(YourTableName, {"C"}, {{"CountColumn", each Table.RowCount(_), Int64.Type}}),
    MergedTable = Table.NestedJoin(YourTableName, {"C"}, GroupedTable, {"C"}, "MergedColumn", JoinKind.LeftOuter),
    ExpandedTable = Table.ExpandTableColumn(MergedTable, "MergedColumn", {"CountColumn"}, {"CountColumn"})
in
    ExpandedTable

 

COUNTIF MR8M:

 

= Table.AddColumn(YourTableName, "CountMR8M", each if [D] = "MR8M" then 1 else 0)

 

sum count

 

let
    SummedTable = Table.Group(YourTableName, {}, {{"TotalMR8M", each List.Sum([CountMR8M]), type number}})
in
    SummedTable

 

:in power query create custom column:

 

= Table.AddColumn(YourTableName, "Condition1", each if [D] = 3 and [E] > 1 then "True" else "False")

 

create custom column

 

= Table.AddColumn(YourTableName, "Condition2", each if Number.Mod([B], 2) = 0 and [F] = 0 and [G] = 0 then "True" else "False")

 

 

Did I answer your question? If so, please mark my post as the solution!
Your Kudos are much appreciated! Proud to be a Resolver III !

View solution in original post

11 REPLIES 11
p45cal
Super User
Super User

re: "Countif MR8M text in the column Text"

How do you determine MR8M ? I don't see it anywhere among the data.

Thanks for your prompt reply

This is my raw data

ScriptsSourceVendorVendorNameCompanyCodeFiscalYearDocumentTypeDocumentDatePostingKeyPostingDateDocumentNumberReferenceAmountindoccurrDocumentcurrencyAmountinlocalcurrencyLocalCurrencyClearingdateTextNetduedateValueCC 
S(0-25)-1SAP2003178780 US292024RE28-02-20233101-08-20245101197126199065-10.7USD-10.7USD VR:Pay-as-billed4/29/2023Below 10K51011971262024US2919906510.7
S(0-25)-1SAP2003215158 US292023RE28-02-20233125-03-20235100017080199065-10.7USD-10.7USD VR:Pay-as-billed4/29/2023Below 10K51000170802023US2919906510.7
S(0-25)-1SAP2003155708 US282024RE11-07-20242131-07-20245101413528NY15-0006466612.9USD12.9USD MR8M11/8/2024Below 10K51014135282024US28NY15-0006466612.9
S(0-25)-1SAP2003155708 US282024RE11-07-20243120-07-20245101491591NY15-00064666-12.9USD-12.9USD  11/8/2024Below 10K51014915912024US28NY15-0006466612.9
S(0-25)-1SAP2000022228 US282024RE21-05-20243123-07-202451015660159125964099-15.28USD-15.28USD VR:Pay-as-billed9/18/2024Below 10K51015660152024US28912596409915.28
S(0-25)-1SAP2000022228 US282024RE21-05-20242123-07-20245101567516912596409915.28USD15.28USD VR:Pay-as-billed9/18/2024Below 10K51015675162024US28912596409915.28
S(0-25)-1SAP2000022228 US282024RE21-05-20242131-07-20245101752521912596409915.28USD15.28USD VR:Pay-as-billed9/18/2024Below 10K51017525212024US28912596409915.28
S(0-25)-1SAP2000022228 US282024RE21-05-20243105-06-202451018740119125964099-15.28USD-15.28USD VR:Pay-as-billed9/18/2024Below 10K51018740112024US28912596409915.28
S(0-25)-1SAP2004365991VESTIS GROUP INCUS292024RE17-07-20243101-08-202451011490404130245299-20.47USD-20.47USD VR:Full Accrual9/15/2024Below 10K51011490402024US29413024529920.47
S(0-25)-1SAP2004365991VESTIS GROUP INCUS292024RE17-07-20242101-08-20245101984655413024529920.47USD20.47USD VR:Full Accrual9/15/2024Below 10K51019846552024US29413024529920.47
S(0-25)-1SAP2003155708 US282024RE05-07-20242131-07-20245101413527NY15-0006458820.5USD20.5USD VR:Full Accrual11/2/2024Below 10K51014135272024US28NY15-0006458820.5
S(0-25)-1SAP2003155708 US282024RE05-07-20243111-07-20245101575516NY15-00064588-20.5USD-20.5USD VR:Full Accrual11/2/2024Below 10K51015755162024US28NY15-0006458820.5
S(25-60)-1SAP110076660SUPPLYFORCE10002024RE03-12-20203101-08-20245135751891S111229788001-149.48USD-149.48USD TICKET SCTASK75073622/1/2021Below 10K513575189120241000S111229788001149.48
S(25-60)-1SAP110077236KIRBY RISK ELECTRICAL SUPPLY10002024ZC03-12-20202101-08-20245135751741S111229788001149.48USD149.48USD MR8M2/1/2021Below 10K513575174120241000S111229788001149.48
S(25-60)-1SAP110013648INGERSOLL RAND CO10002023RE11-07-20233117-07-2023513247631031071227-311.61USD-311.61USD  9/9/2023Below 10K51324763102023100031071227311.61
S(25-60)-1SAP110013648INGERSOLL RAND CO10002024RE11-07-20233131-07-2024513573796931071227-311.61USD-311.61USD TICKET SCTASK75389189/9/2023Below 10K51357379692024100031071227311.61
S(25-60)-1SAP10037358GRAINGER INC10002024RE23-10-20232131-07-20245135738340988002180482.24USD82.24USD7/31/2024SCTASK754128510/23/2023Below 10K513573834020241000988002180482.24
S(25-60)-1SAP110089815GRAINGER INC CR10002024RE23-10-20232109-07-20245135513389988002180482.24USD82.24USD  10/23/2023Below 10K513551338920241000988002180482.24
S(25-60)-1SAP2003155708 US282024RE16-11-20232131-07-20245100822034NY15-00059334281.2USD281.2USD MR8M3/15/2024Below 10K51008220342024US28NY15-00059334281.2
S(25-60)-1SAP2003155708 US282024RE16-11-20233110-07-20245101126254NY15-00059334-281.2USD-281.2USD  3/15/2024Below 10K51011262542024US28NY15-00059334281.2
S(25-60)-1SAP2003155708 US282024RE16-11-20232101-07-20245101239148NY15-00059334281.2USD281.2USD VR:Full Accrual3/15/2024Below 10K51012391482024US28NY15-00059334281.2
S(25-60)-1SAP2003155708 US282024RE16-11-20233102-05-20245101580014NY15-00059334-281.2USD-281.2USD VR:Full Accrual3/15/2024Below 10K51015800142024US28NY15-00059334281.2
S(25-60)-1SAP10037358GRAINGER INC10002023RE05-12-20233122-12-202351339149069923837950-382.63USD-382.63USD Dept#C-PAY1/9/2024Below 10K5133914906202310009923837950382.63
S(25-60)-1SAP10072931GRAINGER INC10002024RE05-12-20233101-08-202451357515759923837950-382.63USD-382.63USD  1/9/2024Below 10K5135751575202410009923837950382.63
S(25-60)-1SAP10037358GRAINGER INC10002023RE11-12-20233127-12-202351339317349930189072-127.54USD-127.54USD  1/15/2024Below 10K5133931734202310009930189072127.54
S(25-60)-1SAP10072931GRAINGER INC10002024RE11-12-20233131-07-202451357378459930189072-127.54USD-127.54USD  1/15/2024Below 10K5135737845202410009930189072127.54
S(25-60)-1SAP10031849IOWA FLUID POWER10002024RE20-12-20233130-07-202451357268141706974-223.24USD-223.24USD  2/18/2024Below 10K5135726814202410001706974223.24
S(25-60)-1SAP10033192IOWA FLUID POWER10002024RE20-12-20233131-07-202451357268141706974-223.24USD-223.24USD  2/18/2024Below 10K5135726814202410001706974223.24
S(25-60)-1SAP2000018636 US282024RE02-02-20242101-08-202451008265062376117343.2USD343.2USD VR:Pay-as-billed4/2/2024Below 10K51008265062024US282376117343.2
S(25-60)-1SAP2000018636 US282024RE02-02-20243119-02-202451009615012376117-343.2USD-343.2USD VR:Pay-as-billed4/2/2024Below 10K51009615012024US282376117343.2
S(25-60)-1SAP110080769SAP AMERICA INC10002024RE13-02-20243101-08-2024513452177610750240000220-198.33USD-198.33USD SCTASK75476524/13/2024Below 10K51345217762024100010750240000220198.33
S(25-60)-1SAP110081079SUCCESSFACTORS INC10002024RE13-02-20243106-03-2024513452177610750240000220-198.33USD-198.33USD   Below 10K51345217762024100010750240000220198.33
S(25-60)-1SAP110088296CINTAS FIRE NATIONAL ACCOUNTS10002024RE23-02-20243113-06-20245135336621I402230584-154USD-154USD  4/23/2024Below 10K513533662120241000I402230584154
S(25-60)-1SAP110088296CINTAS FIRE NATIONAL ACCOUNTS10002024RE23-02-20243131-07-20245135738154I402230584-154USD-154USD  4/23/2024Below 10K513573815420241000I402230584154
S(25-60)-1SAP2003183692 US292024RE08-03-20243110-05-20245100937885I403081025-437.34USD-437.34USD VR:Pay-as-billed5/7/2024Below 10K51009378852024US29I403081025437.34
S(25-60)-1SAP2003183692 US292024RE08-03-20242111-07-20245101564525I403081025437.34USD437.34USD VR:Pay-as-billed5/7/2024Below 10K51015645252024US29I403081025437.34
S(25-60)-1SAP2004015811 US292024RE08-03-20243101-08-20245101111176I403081025-437.34USD-437.34USD VR:Pay-as-billed5/7/2024Below 10K51011111762024US29I403081025437.34
S(25-60)-1SAP2000022228 US282024RE01-05-20243110-05-202451009655069104797676-83.41USD-83.41USD  8/29/2024Below 10K51009655062024US28910479767683.41
S(25-60)-1SAP2000022228 US282024RE01-05-20242131-07-20245101205008910479767683.41USD83.41USD MR8M8/29/2024Below 10K51012050082024US28910479767683.41

I've made a start in the linked-to workbook below using the data in your last reply.

There's a Power Query query table at cell AI3.

Curious that some date columns are UK-style dates and others US-style dates!

p45cal_0-1723631198713.png

Your data has been grouped by the first 2 columns. There's only F-44 Clearing in the Comment column because no other comment applies in your data.

The workbook: https://app.box.com/s/qv411rzbbntw4bt9be6h81x7ihgyk1hr

Thanks for kind help

Can you please give me M code for the same

It's in the linked-to workbook at the end of my last message.

jennratten
Super User
Super User

Hello - can you please provide an example of the expected result so we can better understand what you are trying to accomplish?  The description provided is a bit confusing.  Thanks!

Thanks for prompt reply

This is input data

ReferenceAmountindoccurr
199065-10.7
199065-10.7
NY15-0006466612.9
NY15-00064666-12.9
9125964099-15.28
912596409915.28
912596409915.28
9125964099-15.28
4130245299-20.47
413024529920.47
NY15-0006458820.5
NY15-00064588-20.5
S111229788001-149.48
S111229788001149.48
31071227-311.61
31071227-311.61
988002180482.24
988002180482.24
NY15-00059334281.2
NY15-00059334-281.2
NY15-00059334281.2
NY15-00059334-281.2
9923837950-382.63
9923837950-382.63
9930189072-127.54
9930189072-127.54
1706974-223.24
1706974-223.24
2376117343.2
2376117-343.2
10750240000220-198.33
10750240000220-198.33
I402230584-154
I402230584-154
I403081025-437.34
I403081025437.34
I403081025-437.34
9104797676-83.41
910479767683.41
INV-82351728083-109.88
INV-82351728083109.88
198141192-102.84
198141192102.84
198141192102.84
198141192-102.84
198141192-102.84
198141192102.84
AR2108052-159.38
AR2108052159.38
18720268495
187202684-95
18720268595
187202685-95
187203048-100
187203048100
187203046205
187203046-205
03S7548890-321.5
03S7548890-321.5
18720304780
187203047-80
NY15-0006455771.2
NY15-00064557-71.2
187203367-243.62
187203367243.62
NY15-0006459453.62
NY15-00064594-53.62
NY15-00064584-262.64
NY15-00064584262.64
NY15-0006467465.5
NY15-00064674-65.5
4198862563-248.2
4198862563248.2
4198862563-248.2
SI-18621-293.73
SI-18621-293.73
SI-18621293.73
198143236-102.84
198143236102.84
198143236-102.84
198143236102.84
198143239102.84
198143239-102.84
198143239-102.84
198143239102.84
NY15-00064825109.3
NY15-00064825-109.3
SVC606275-164.82
SVC606275-164.82
SVC606274-206.03
SVC606274-206.03
19814408556.02
198144085-56.02
19814408556.02
198144085-56.02
19814408656.03
198144086-56.03
198144086-56.03
19814408656.03
198144079-112.04
198144079-112.04
198144079112.04
198144079112.04
198144080-280.09
198144080-280.09
198144080280.09
198144080280.09
198144087-280.11
198144087280.11
198144087-280.11
198144087280.11
198144078480.62
198144078-480.62
198144078480.62
198144078-480.62
5019015752-124.07
5019015752-124.07
AR2113693159.38
AR2113693-159.38
H1032801247.8
H1032801-247.8
H1013701294.12
H1013701-294.12
H0994001397.08
H0994001-397.08
147455353101.65
147455353-101.65
147455492101.65
147455492-101.65
147455493101.65
187203046205

 

Output should be 

ReferenceAmountindoccurrConcatenateSumCountIFMR8MComments
000000079314-2200000000007931422000-2200031Less priority
0000000793142200000000007931422000-2200031Less priority
000000079314-2200000000007931422000-2200031Less priority
000000080007CO-7500000000080007CO7500-750010 
0000009-150000000091500-150010 
0000035-7500000035750-75010 

Hey @KuntalSingh, try this and let me know if you encounter any issues.


In a new sheet:

=A2 & ABS(B2)

 

=SUMIF($C$2:$C$100, C2, $B$2:$B$100)

 

=COUNTIF($C$2:$C$100, C2)

 

=COUNTIF(D:D, "MR8M")

 
Home-> Conditional Formatting -> New Rule:

=AND($D2=3, $E2>1)

 

  Home-> Conditional Formatting -> New Rule:

 

=AND(MOD($B2, 2)=0, $F2=0, $G2=0)

 

Thanks for relpy 

I am able to do it in excel but need same in power query Need M code.

@KuntalSingh, go ahead and try it, and if you hit any snags, just reach out.

 in power query, create a new column

 

= Table.AddColumn(YourTableName, "ConcatenatedColumn", each [A] & Number.ToText(Number.Abs([B])))

 

SUMIF:

 

let
    GroupedTable = Table.Group(YourTableName, {"C"}, {{"SumColumn", each List.Sum([B]), type number}}),
    MergedTable = Table.NestedJoin(YourTableName, {"C"}, GroupedTable, {"C"}, "MergedColumn", JoinKind.LeftOuter),
    ExpandedTable = Table.ExpandTableColumn(MergedTable, "MergedColumn", {"SumColumn"}, {"SumColumn"})
in
    ExpandedTable

 

COUNTIF:

 

let
    GroupedTable = Table.Group(YourTableName, {"C"}, {{"CountColumn", each Table.RowCount(_), Int64.Type}}),
    MergedTable = Table.NestedJoin(YourTableName, {"C"}, GroupedTable, {"C"}, "MergedColumn", JoinKind.LeftOuter),
    ExpandedTable = Table.ExpandTableColumn(MergedTable, "MergedColumn", {"CountColumn"}, {"CountColumn"})
in
    ExpandedTable

 

COUNTIF MR8M:

 

= Table.AddColumn(YourTableName, "CountMR8M", each if [D] = "MR8M" then 1 else 0)

 

sum count

 

let
    SummedTable = Table.Group(YourTableName, {}, {{"TotalMR8M", each List.Sum([CountMR8M]), type number}})
in
    SummedTable

 

:in power query create custom column:

 

= Table.AddColumn(YourTableName, "Condition1", each if [D] = 3 and [E] > 1 then "True" else "False")

 

create custom column

 

= Table.AddColumn(YourTableName, "Condition2", each if Number.Mod([B], 2) = 0 and [F] = 0 and [G] = 0 then "True" else "False")

 

 

Did I answer your question? If so, please mark my post as the solution!
Your Kudos are much appreciated! Proud to be a Resolver III !

Thank you very much for yor kind support!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors