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
Parthsh93
Helper IV
Helper IV

Missing totals

Hi, I have been having issue of not getting totals in my calculations when using Table visualization or otherwise.

 

Formulas I am using:

1. _Loadability by cases per trips =
CALCULATE(
DIVIDE([0_Total Volume Shipped by Cases],[0_Total Shipments],BLANK()
))

 

2. last month loadability BCPT =

CALCULATE(

[ _Loadability by cases per trips ],DATEADD (dDate[Date],-1,MONTH)

)

 

3. Trips saved VS last Month =
CALCULATE(

IF(

[last month loadability BCPT]=0,BLANK(),CALCULATE(

                                                      (DIVIDE ( [0_Total Volume Shipped by Cases] , [last month loadability BCPT] , BLANK()

                                                       ) - [0_Total Shipments])

)))

 

Totals Not Showing.2.PNG

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

One approach is to keep your current measures and make new ones with this pattern (assuming you have a YearMonth column in your Date table):

 

NewMeasure = sumx(Values(Date[YearMonth]), [existing measure])

 

That should work both in your rows for each YearMonth and for the total.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Year measures are written... well, suboptimally, to say it mildly. Here are the correct versions:

1. [_Loadability by cases per trips] =
DIVIDE(
	[0_Total Volume Shipped by Cases],
	[0_Total Shipments]
)

2. [last month loadability BCPT] =
CALCULATE(
	[_Loadability by cases per trips],
	DATEADD (dDate[Date], -1, MONTH)
)

3. [Trips saved VS last Month] =
var __loadability = [last month loadability BCPT]
return
	if( __loadability,
		DIVIDE (
			[0_Total Volume Shipped by Cases],
			__loadability
		) - [0_Total Shipments]
	)

 

As for the totals... You have not given the rule for their calculation, so nobody can tell you what they should be.

 

Best

D

mahoneypat
Employee
Employee

One approach is to keep your current measures and make new ones with this pattern (assuming you have a YearMonth column in your Date table):

 

NewMeasure = sumx(Values(Date[YearMonth]), [existing measure])

 

That should work both in your rows for each YearMonth and for the total.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.

Top Solution Authors