Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Measure as Calculated Column

Hello All, I have been struggling to resolve this.

 

I have measure which calculates the month difference from 2 dates which are measures. i need to apply that measure value in creating a flag with the below

NewWin=IF (
            Sales[cust] = "Not Defined",
            0,
            IF ( Sales[MonthCount] ) < 13, 1, 0 )
        )

 

- Sales[Cust] is a calculated column
- Sales[MonthCount] is a measure

I am able to create this as measure but not in calculated column, I need calculated column so that I can use this as slicer, can anyone please help?
Ashish_Mathur  can you please look at this?

3 Replies

  • Hi,

    Measures should not be referred to in calculated column formulas because calculated column formulas do not respond to change in filters/slicers.

    Please share a dataset, describe the business question and show the expected result.  There could be a way to write a calculated column formula without calling a measure inside it.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for your response. I am trying to find new customer wins compared in different time periods.

      The below table has the logic in step by step for each time frame. TF is time frame.

      Logic is, user selects year and month, if the CPDF number exists in the current month, get the earliest revenue date. Then from the current selected period, look back upto 12 months and find the earliest revenue date date, if the earliest invoice date is same as current period, then look back upto one more 12 months and find the earliest revenue date, if exists then check if the difference between this date and originally selected period is less than 13 months, if yes, then its a new win. 

       

      I am able to create this logic and measures and owrks perfectly, however the challenge is I need to be able to select the New win as filter or slicer, so that user can select year, month and new win as yes or no. But I am not able to use measure as column to apply in filter/slicer.

       

      Really appreciate your help in advance Ashish_Mathur 

       

      Here is the test file. https://1drv.ms/u/s!AoC3T84cA7LGjl3HbemEMeGx29Y_

       

      Customer Parent number & Draws Combined Number (CPDF)Start DateEnd DateFIRST EARLIEST Revenue DATE IN Selected PeriodTF1 Start DateTF1 End Date"TF1 Date"TF2 Start DateTF2 End DateTF2 DateEnd Date of TF2 DateMonth Difference (TF2 and Selected Period)New Win ?
      63759DF1612/1/201812/31/201812/2/201812/31/20181/1/201812/4/201712/31/20171/1/20161/1/20161/31/201636No
      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        I will not be able to help here because one cannot refer to a measure within a calculated column formula.