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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Petrx
New Member

Help needed - measures/matrix

Hello,

 

Please, I am looking for help with creating of matrix from general ledger (accounting).

 

- I have some accounts used in the general ledger (data source table) where one transaction equals one line where both debit and credit column is used in this line (with different accounts) and the same amount is used for both sides (debit and credit columns at each line).

- Each account can be used both at debit and credit side,

- Amounts can be with both positive and negative sign both at debit or credit side,

- I need to create a matrix where I will have one column with account number (at lines each account appears only once), and sum of debits (column) and sum of credits (column) and the difference between Debit and Credit columns (all for each account used), all to be filtered by date  (UMD = debit, UD = credit, Kc = amount valid for both UMD and UD account).

- The source look like this (first column is debit, second column is credit, third column is amount).

Petrx_2-1628964445409.png

The output shall be:

Account; sum of amounts at debit side; sum of amounts at credit side; difference between sum of amounts.

 

Can you please help?

Thank you

Petr

 

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Petrx ;

You could unpivot column in power query ,then create a measure .

1. unpivot in power query.(Selected UMD and UD column then unpivot)

vyalanwumsft_0-1629166443579.pngvyalanwumsft_1-1629166475598.png

2. create a measure.

Measure = IF(ISINSCOPE('Table'[kind]),SUM([Kc]),SUMX(FILTER('Table',[kind]="UMD"),[Kc])-SUMX(FILTER('Table',[kind]="UD"),[Kc]))

The final output is shown below:

vyalanwumsft_2-1629166530147.png

Best Regards,
Community Support Team_ Yalan Wu
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-yalanwu-msft
Community Support
Community Support

Hi, @Petrx ;

You could unpivot column in power query ,then create a measure .

1. unpivot in power query.(Selected UMD and UD column then unpivot)

vyalanwumsft_0-1629166443579.pngvyalanwumsft_1-1629166475598.png

2. create a measure.

Measure = IF(ISINSCOPE('Table'[kind]),SUM([Kc]),SUMX(FILTER('Table',[kind]="UMD"),[Kc])-SUMX(FILTER('Table',[kind]="UD"),[Kc]))

The final output is shown below:

vyalanwumsft_2-1629166530147.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

aj1973
Community Champion
Community Champion

Hi @Petrx 

When dealing with GL(General Ledger) You need to start grouping the Accounts numbers then use DAX to sum up those accounts Debit & Credit.

Check this out

Microsoft Power BI

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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