# Power BI Exchange

View Only

## Getting the total value of a created Measure #### Osama AshrafSep 09, 2021 03:13 AM #### Melissa de KorteSep 11, 2021 10:33 AM • #### 1.  Getting the total value of a created Measure

Posted Sep 09, 2021 03:13 AM

#### This is the formula measure:

``````Meter 1 Consumption =
VAR ConsumptionToday =
CALCULATE(SUM(ConsumptionDaily[QC Meter 1]))
VAR ConsumptionPriorDay =
CALCULATE(SUM(ConsumptionDaily[QC Meter 1]), PREVIOUSDAY('ConsumptionDaily'[Date]))
VAR DIFF =
ConsumptionToday - ConsumptionPriorDay
RETURN
IF(ISBLANK(ConsumptionPriorDay),BLANK(),IF(DIFF<0,DIFF+9999999,DIFF))``````
How can i get the sum of Meter 1 Consumption, I have tried to use sumx and seen some solutions using HAS1Filter
Sum of Meter 1 = CALCULATE(SUMX(ConsumptionDaily,[QC Meter 1 Consumption])) But it is showing blank when adding into a visual,

### If you can help please ------------------------------
Osama Ashraf
Jr Data specialist
------------------------------

• #### 2.  RE: Getting the total value of a created Measure

Posted Sep 11, 2021 10:33 AM
Hi @Osama Ashraf,

Knowing nothing about your Model makes this a bit of a guessing game, but since you have a date field ​and are using a date in your visual - you must have a (proper) Date table, right? Try something like this.

`SUMX(`
`    ADDCOLUMNS(`
`        VALUES( Dates[Date] ),`
`        "Value", [Meter 1 Consumption]`
`    ),`
`    [Value]`
`)`
Review this video if you run into any issues.
Calculate totals by summing visible values in DAX

------------------------------
Melissa de Korte
------------------------------

• #### 3.  RE: Getting the total value of a created Measure

Posted Sep 13, 2021 12:48 PM
Hi @Melissa,