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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jellis1971
Helper IV
Helper IV

Creating Columns with DAX Formulas

The first screenshot below is my Power BI Report. 

The second is its list of tables, with Account Category derived from the Chart of Accounts table.

I need help with DAX, for creating columns in a new Visualization.

I want a column showing the Account Category of "Income" and another column showing "Cost of Goods Sold".

Then, I want separate columns pertaining to Dimension_Value_Code showing "ADM", "LARGE", "MEDIUM", "PROD", "SALES", "SERVICE", and "SMALL".

Also, I want two additional columns pertaining to "Amount" with the amounts pertaining to Income in one column and those pertaining to Cost of Goods Sold in another.

Finally, I need a Gross Margin column subtracting each amount of Cost of Goods Sold from each amount of Income.

What DAX fomulas can I use to create these columns?

Thanks!

John

jellis1971_0-1679088778631.png

jellis1971_1-1679088872282.png

 

1 ACCEPTED SOLUTION
andhiii079845
Solution Sage
Solution Sage

First, please make a good data example for all involved tables with the forum table function. In the moment it its difficult to find the right columns from the tables .In general you can create a column with a measure in your matrix: E.g. 

Amount of Income = sumx(FILTER(G_LEntries,Related(Chart of Account[Account Category])="Income")),G_LEntries[Amount])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
jellis1971
Helper IV
Helper IV

Thank you!  That worked perfectly!

John

andhiii079845
Solution Sage
Solution Sage

First, please make a good data example for all involved tables with the forum table function. In the moment it its difficult to find the right columns from the tables .In general you can create a column with a measure in your matrix: E.g. 

Amount of Income = sumx(FILTER(G_LEntries,Related(Chart of Account[Account Category])="Income")),G_LEntries[Amount])





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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