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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JADG
New Member

Sum a single value in a visual report with a Total Value

Hi Everyone

I'm very new in Power BI and I'm trying to learn DAX but I still have some basic issues

 

I have the following scenario:

- Table A with a list of Admissions Freight cost. (The freight cost is a single value for the whole admission)

- Table B all the batches for the Admissions

- Table C is the transactional table

 

How I can Sum Freight cost to Total Cost in the visual report?

 

Table A 
AdmissionsFreight  Cost
ADM01800
ADM02300
ADM035000

 

Table B 
AdmissionsBatch
ADM01Batch1
ADM01Batch2
ADM01Batch3

 

Table C   
KeyProdBatchCost
TableKeyProduct1Batch11000
TableKeyProduct1Batch15000
TableKeyProduct1Batch14000

 

Visual Table  
AdmissionFreight Cost from Table ATotal Cost (Sum of Transaction for ADM) Table BTotal + Freight
ADM018001000010800
ADM0230050005300
ADM0350001500020000

 

Regards

JADG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @JADG ,

 

Make the following relationships:

  • Table A [Admissions] (1) -> Table B [Admissions] (Many)
  • Table B [Batch] (1) -> Table C [Batch] (Many)

Then create the following measure:

 

Total + Freight = SUM(TableA[Freight  Cost])  +SUM(TableC[Cost])

Now make you table with the following  setup:

 

  • TableA[Admissions]
  • TableA[Freigth Costs]
  • TableC[Cost]
  • [Total+Freight]

Check the result on the PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @JADG ,

 

Make the following relationships:

  • Table A [Admissions] (1) -> Table B [Admissions] (Many)
  • Table B [Batch] (1) -> Table C [Batch] (Many)

Then create the following measure:

 

Total + Freight = SUM(TableA[Freight  Cost])  +SUM(TableC[Cost])

Now make you table with the following  setup:

 

  • TableA[Admissions]
  • TableA[Freigth Costs]
  • TableC[Cost]
  • [Total+Freight]

Check the result on the PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.