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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
julie_bunavicz
Frequent Visitor

DAX for Column and Row by Row Totals

Hi,

 

I'm trying to create a DAX multiplication function and see the results row by row along with a column subtotal.  However, The results do not always match expected.  See example below.

 

I did a little research and I believe this is related to Row Iteration issues in Power BI.

 

Can someone please help me with the DAX and concept?

 

Extended Cost = vw_abc[Qty]*vw_abc[Unit Cost]

 

DAX Results.png

 

 

 

Many thanks,

 

Julie Bunavicz

4 REPLIES 4
julie_bunavicz
Frequent Visitor

I sincerely appreciate your help. I cannot share the file, but here's a mock screen shot and summary.  I did a little research and played around so my orginal formula has changed.   The goal is one column for Extended Cost with correct total row by row and column. 

 

Below are two examples to demonstrate the issue.  NOTE - There are no filters applied to the report

 

1.  The "Extended Cost" measure calculates row by row correctly but results in the wrong column total.

 

Extended Cost = CALCULATE(SUM('vw_reciepts'[_ReceivedQty])) * SUM('vw_reciepts'[_UnitCost])

julie_bunavicz_0-1702585373441.png

 

2.  The "Extended Cost 2" custom column works for calculating column total but results in wrong row calculations at random.


Extended Cost 2 = CALCULATE(SUMX('vw_reciepts',vw_reciepts[Received Qty]*vw_reciepts[Unit Cost]))

 

julie_bunavicz_1-1702585523702.png

 

Any ideas or suggestions?

 

Let me know if you have any questions.

 

Thanks,

 

Julie

julie_bunavicz
Frequent Visitor

I appriciate your help Ahmedx.  Unfortunetly something still seems off.  Any idea?

julie_bunavicz_2-1702484154947.png

 

share the file so we understand what’s wrong with

Ahmedx
Super User
Super User

pls try this

SUMX total price = SUMX('vw_abc','vw_abc[Qty]*vw_abc[Unit Cost])

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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