Forum Discussion

Jackbaz99's avatar
Jackbaz99
Icon for Helper I rankHelper I
4 years ago
Solved

Referencing Measures within Calculate

Hi, ihave created the follwoing code below to show zeros on a graph where the DATA doesnt exist, see below:

 

 

Concessions Raised = SUMX(FILTER('Date Table','Date Table'[Date] <= TODAY()),CALCULATE(COUNT('Sub_Concession'[Date_Raised])+0))

 

 

It works as intended - i get a graph with 0 if the data doesnt exist and it filters between my dates. 

 

However - i want to do this with a measure, instead of a column reference. the current code is below - how can i make this do the same as the above?

 

DPPM Number = SUM('Sub_Cust Reject'[Qty]) / SUM('Sub_Release Notes'[Qty]) * 1000000 + 0

 


Thank you

  • Hi amitchandak - I have figured the issue and the below does what i want to do

     

    DPPM Number = AVERAGEX(FILTER('Date Table','Date Table'[Date] <= TODAY()) , SUM('Sub_Cust Reject'[Qty]) / SUM('Sub_Release Notes'[Qty]) * 1000000 + 0)

     

    Thanks for getting me on my way 🙂 

5 Replies

  • Jackbaz99 , Th second measure is fine. DO you want to add filter to that ?

    example 

    DPPM Number = CALCULATE(SUM('Sub_Cust Reject'[Qty]) / SUM('Sub_Release Notes'[Qty]),FILTER('Date Table','Date Table'[Date] <= TODAY())) * 1000000 + 0

  • Hi amitchandak - I have figured the issue and the below does what i want to do

     

    DPPM Number = AVERAGEX(FILTER('Date Table','Date Table'[Date] <= TODAY()) , SUM('Sub_Cust Reject'[Qty]) / SUM('Sub_Release Notes'[Qty]) * 1000000 + 0)

     

    Thanks for getting me on my way 🙂