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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to do the calculation in Dax Measure at row level?

        Period     
        AprilMay     
GL CodeDescriptionGL TypeAmountPeriod  Gross Sales100110     
aGross sales GLGross Sales100April  Discounts2030     
dDiscount GLDiscount20April  Net Sales8080calculated new field(Gross -Discount) 
bRaw Material GLRM50April  RM5060     
cProcessing Cost GLOverhead10April  Overhead1020     
aGross sales GLGross Sales110May  Total Expenses6080calculated new field(RM + Overhead) 
dDiscount GLDiscount30May  Net Profit200calculated new Field(Net Sales - Total Expenses)
bRaw Material GLRM60May          
cProcessing Cost GLOverhead20May  I want to measure Calculated New Field       
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You may enter into Query Editor, select on [GL Type], then go to Transform ->Pivot Column, don't forget to click button "Close & Apply".

117.png

Then you may create columns like DAX below, choose Matrix visual to display the series of GL Type columns or fields as you demand into Values box of matrix, put Period into Rows box, turn on the option "Show on rows" under Values option in Format pane.

 

Net sales = [Gross Sales]-[Discount]

 

Total Expenses = [RM]+[Overhead]

 

Net Profit = [Net sales]- [Total Expenses]

Show on values.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Result:

118.png

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

 

Could you please provide the screenshot of your raw data and the expected results that you want?

 





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

Proud to be a Super User!




Anonymous
Not applicable

 
 
 

Hi,

 

I am trying to build a P&L account from the monthly TrialBalance of a company and I am stuck with an issue in achieving row level calculation.

Following is my base sample data for 2 months in BI(I have separate trials for the period and I have combined them in BI )

 

     
     
GL CodeDescriptionGL TypeAmountPeriod
aGross sales GLGross Sales100April
dDiscount GLDiscount20April
bRaw Material GLRM50April
cProcessing Cost GLOverhead10April
aGross sales GLGross Sales110May
dDiscount GLDiscount30May
bRaw Material GLRM60May
cProcessing Cost GLOverhead20May

 

I am trying to achieve the following output, but I am unable to do the required calculations(calculated New Fields) in row level.

 

 Period     
 AprilMay     
Gross Sales100110     
Discounts2030     
Net Sales8080calculated new field(Gross -Discount) 
RM5060     
Overhead1020     
Total Expenses6080calculated new field(RM + Overhead) 
Net Profit200calculated new Field(Net Sales - Total Expenses)
        

 

Kindly help me with the solution. Thanks in advance!!

Hi @Anonymous ,

 

You may enter into Query Editor, select on [GL Type], then go to Transform ->Pivot Column, don't forget to click button "Close & Apply".

117.png

Then you may create columns like DAX below, choose Matrix visual to display the series of GL Type columns or fields as you demand into Values box of matrix, put Period into Rows box, turn on the option "Show on rows" under Values option in Format pane.

 

Net sales = [Gross Sales]-[Discount]

 

Total Expenses = [RM]+[Overhead]

 

Net Profit = [Net sales]- [Total Expenses]

Show on values.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Result:

118.png

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors