IF FUNCTION IN POWER QUERY

aam1932

Board Regular
Joined
Jun 2, 2010
Messages
182
Hai all

Any possible that i want the result to determine D (debit) C (credit) not only based only amount column, but based on the total that particular account in the table as below:
As example, acc_code now currently showing debit amount of 19746434.24, how ever actually i have fews other BU and if i total up all the account code the amount negative, the result in the column D C, should be C and not D.

Thank you

1589735595611.png
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
If I understand correctly, can't you use a Group By first, then apply the If and finally expand the Grouped Table again?

GRoup By on BU, use aggregations SUM of Amount and All Rows (to keep all details available). Extract data from the tables created by All Rows you need.
 
Upvote 0
Thank you for your reply,

I can’t used group by due to, I still need report by individuals BU. The grouping of eirther D or C determine from overall total and not based on individual balance.

thank you
 
Upvote 0
maybe post representative example data and expected result.
use xl2bb or link to shared excel file
 
Upvote 0
i have problem install XL2BB, but below the sample data (only show sample one account). FYI, FY only have 2 items, either Closing Mar20 or Opening Dec19

Thank you

1589771278415.png
 
Upvote 0
try again (picture is useless - data not copyable) select the range you show, copy then paste to the post
no one want to retype your example, sorry

btw. the text about expected result should be generated also?
I asked about expected result (table) not description
 
Last edited:
Upvote 0
below the table, thank you
BUFYACC_CODESum of AMOUNTExpected result
MGOClosing Mar2019657 22,707.56D
RLLClosing Mar2019657 5,536,450.00D
RLOClosing Mar2019657 520,860.00D
RTLClosing Mar2019657 (1,148,339.07)D
RLLOpening Dec1919657 (5,475,846.00)C
RLOOpening Dec1919657 520,912.00C
* No - for closing Mar 20 all line should be D
and for Opening Dec 19 all line should be C
 
Upvote 0
check if this is what you want for this source only
cd.png

or post REPRESENTATIVE example of source data
 
Upvote 0
Thank you for your reply,

I can’t used group by due to, I still need report by individuals BU. The grouping of eirther D or C determine from overall total and not based on individual balance.

thank you
Group by on BU Will keep all BUs. So I don't understand the feedback. Also I mention to use All Rows as an aggregation. Meaning you can extract again all details from those subtables.
 
Upvote 0

Forum statistics

Threads
1,223,793
Messages
6,174,623
Members
452,574
Latest member
hang_and_bang

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top