Forum Discussion

julesdude's avatar
julesdude
Icon for Post Partisan rankPost Partisan
4 years ago
Solved

Getting Correct Grand Totals Following Measure Column

Hi there,

I've had some valuable help here building the following DAX measure that will provide me with totals based on conditions to achieve this:

 

DAX measure is:

Measure = 

VAR _0 = LASTDATE ( 'Table'[Date] )
VAR _1 = CALCULATE ( LASTDATE( 'Table'[Date] ) , ALLEXCEPT ( 'Table' ,'Table'[Country] ,'Table'[Asset Reference] ) )
VAR _2 = IF ( _1 = _0 , SUM ('Table'[Amount] ) , BLANK() )

RETURN

_2

 

However, as you can see in the total in the table above, it's not a reflection of what is in the column.

 

How can I achieve this?

6 Replies

    • julesdude's avatar
      julesdude
      Icon for Post Partisan rankPost Partisan

      Hi Greg_Deckler 

      Many thanks for the valuable link and your post. The Final Word worked brilliantly and I shall refer to this in future whenever i hit this issue. 

      I added to the above code creating a new measure which references my original measure, and it is this new measure that the visualisation now uses directly,

      Thanks again

    • julesdude's avatar
      julesdude
      Icon for Post Partisan rankPost Partisan

      Hi tamerj1 
      In the top table of the screenshot I pasted, far right column 'Measure New', the values the measure is displaying aren't adding up to the Total displayed. 
      That means it's a problem for the pie chart I'm compiling underneath as the figures in that pie chart aren't actually representative of the table above it. The table beneath the pie chart is basically the same data but in a table, to illustrate it another way.

      So, I'm hoping for a solution around this common problem.

      • tamerj1's avatar
        tamerj1
        Icon for Community Champion rankCommunity Champion

        julesdude 

        Sorry I was so busy yesterday I diyhave the chance to look into this. Can you please describe in works what this measure is intended to calculate? Thank you