topic Getting the total value of a created Measure in DAX Commands and Tips
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Getting-the-total-value-of-a-created-Measure/m-p/2065910#M46679
<H4>I am still developing in power Bi, I am having an issue in getting the total value of a calculated measure, the measure is calculating daily consumption readings and i want to get the total for the selected period. </H4><H4>This is the measure formula: </H4><LI-CODE lang="markup">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))</LI-CODE><H4><SPAN>How to get the sum of Meter 1 Consumption, i have tried to use sumx and seen some solutions using HAS1Filter </SPAN></H4><DIV><H4><SPAN>Sum of Meter 1 = CALCULATE(SUMX(ConsumptionDaily,[QC Meter 1 Consumption]))</SPAN></H4><H4><SPAN>But it is showing blank, </SPAN></H4><H3><STRONG>If you can help please </STRONG></H3></DIV><H1> </H1>Thu, 09 Sep 2021 06:59:32 GMTOsama142021-09-09T06:59:32ZGetting the total value of a created Measure
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Getting-the-total-value-of-a-created-Measure/m-p/2065910#M46679
<H4>I am still developing in power Bi, I am having an issue in getting the total value of a calculated measure, the measure is calculating daily consumption readings and i want to get the total for the selected period. </H4><H4>This is the measure formula: </H4><LI-CODE lang="markup">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))</LI-CODE><H4><SPAN>How to get the sum of Meter 1 Consumption, i have tried to use sumx and seen some solutions using HAS1Filter </SPAN></H4><DIV><H4><SPAN>Sum of Meter 1 = CALCULATE(SUMX(ConsumptionDaily,[QC Meter 1 Consumption]))</SPAN></H4><H4><SPAN>But it is showing blank, </SPAN></H4><H3><STRONG>If you can help please </STRONG></H3></DIV><H1> </H1>Thu, 09 Sep 2021 06:59:32 GMThttps://community.powerbi.com/t5/DAX-Commands-and-Tips/Getting-the-total-value-of-a-created-Measure/m-p/2065910#M46679Osama142021-09-09T06:59:32ZRe: Getting the total value of a created Measure
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Getting-the-total-value-of-a-created-Measure/m-p/2067446#M46736
<P>You should use the effect of a telescopic sum here.<BR />Instead of summing over all of the daily consumptions, just calculate the difference between first consumption and last consumption within the time, using your logic:<BR /><BR /></P><LI-CODE lang="markup">Meter 1 Consumption =
VAR MaxDate = MAXX(Datecolumn)
VAR MinDate = MINX(Datecolumn)
VAR ConsumptionEnd =
CALCULATE(SUM(ConsumptionDaily[QC Meter 1]), date = MaxDate)
VAR ConsumptionStart =
CALCULATE(SUM(ConsumptionDaily[QC Meter 1]), Datecolumn = MinDate)
VAR DIFF =
ConsumptionEnd - ConsumptionStart
RETURN
IF(ISBLANK(ConsumptionStart),BLANK(),IF(DIFF<0,DIFF+9999999,DIFF))</LI-CODE><P>Might need to substract one day from MinDate.</P>Thu, 09 Sep 2021 18:30:38 GMThttps://community.powerbi.com/t5/DAX-Commands-and-Tips/Getting-the-total-value-of-a-created-Measure/m-p/2067446#M46736Schmidtmayer2021-09-09T18:30:38Z