Total Not Showing in Table

Hi all,

I created a Datediff measure with conditional if statement, see image #1, that works like a charm but it doesn’t add the total when I put the measure in a table, see image #2, there is no total. What can i do in the measure so the total can be visible.

Image #1
image

Image # 2

Working file is also attached.

Thanks for your help.
PPD Prosepcts Report.pbix (27.1 MB)

Hello @ysherriff,

Thank You for posting your query onto the Forum.

In order to achieve the results based on the scenario that you’ve specified. Below is the measure alongwith the screenshot of the final results provided for the reference -

$ HubSpot Campaign RFP - Harsh =
VAR _Start_Day = 0

VAR _End_Day = 548

VAR _Date_Range_Condition =
FILTER( Deal ,
    DATEDIFF( Deal[RFP Received Date] , Deal[Campaign Member Create Date] , DAY ) >= _Start_Day &&
    DATEDIFF( Deal[RFP Received Date] , Deal[Campaign Member Create Date] , DAY ) <= _End_Day )

VAR _Results =
CALCULATE( SUM( Deal[RFP Amount] ) ,
    _Date_Range_Condition )

RETURN
_Results

I’m also attaching the working of the PBIX file for the reference purposes.

Hoping you find this useful and meets your requirements that you’ve been looking for.

Thanks and Warm Regards,
Harsh

PPD Prosepcts Report - Harsh.pbix (27.1 MB)

3 Likes

Thanks again Harsh luke always fast response

1 Like

Hello @ysherriff,

You’re Welcome!!! :slightly_smiling_face:

I’m glad that I was able to assist you.

Thanks and Warm Regards,
Harsh

1 Like

I forgot to ask. Could you kindly explain why your syntax worked and mine did not?

I want to learn. Much rhx

Hello @ysherriff,

Here’s the explanation between the two measures -

In old measure, you had stated the condition as - “If date range is in between 0 and 548 then provide the results of RFP Amount or else 0”.

So what it actually did is, it provided you with the correct results at an individual line item level but at a grand total level since there was no presence of any context, it evaluated the results as 0. And that’s why, it didn’t provided the overall summation of results at a grand total level.

Similarly, you could have achieved the same results by creating a measure in order to fix the totals. Below is the measure provided for the reference -

Fix Totals = 
SUMX(
   ADDCOLUMNS(
      SUMMARIZE(
          Deal , 
          Deal[Yuhanna's Campaign Test] , 
          Deal[Deal Name] ) , 
      "@Totals" , 
      [$ HubSpot Campaign RFP] ) , 
   [@Totals] )

But what I did is, removed that IF statement since in this particular scenario, it was not required and substituted that same condition or logic inside the Filter function as an expression.

I’m providing few links below for the reference purposes where similar type of queries were raised in the past by the members on our forum and how the “IF()” function works when it’s context is misunderstood.

Hoping you find this helpful.

Thanks and Warm Regards,
Harsh

1 Like

:grin: :pray:

Hi,

I wanted to get the average RFP Influence time so I used your example of Fix Totals and it works perfectly but how can I modify to exclude negative values?

Average Influence Time for Total = //includes negative values
AVERAGEX(
ADDCOLUMNS(
SUMMARIZE(
Deal,
Deal[Yuhanna’s Campaign Test],
Deal[Deal Name]),
@Averages”,
[RFP Influence TIME]),
[@Averages])

Hello @ysherriff,

Based on the measure that you’ve provided, I evaluated the results and exported them into an Excel file and nowhere I was able to see any negative values. The starting value that I see is itself from postive 1. Below is the screenshot provided for the reference -

Thanks and Warm Regards,
Harsh

1 Like