Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Column ignores Measure value

Hi,

 

I have a measure as such,

 

Measure = IF(DISTINCTCOUNT('Accrued Income'[Month Year])>1,"A","B")
 
I'm then using that measure in a column to return a URL based on that value of that measure, as below.
 
VAR _DNIorError = 'Accrued Income'[DNIorError]
VAR _Param = "rp:DNIOrError="&_DNIorError
VAR _Year = 'Accrued Income'[Year]
VAR _Param2 = "&rp:Year="&_Year
VAR _ReportGroup = 'Accrued Income'[ReportGroup]
VAR _Param3 = "&rp:ReportGroup="&_ReportGroup
VAR _AfterNov16 = 'Accrued Income'[After Nov-16]
VAR _Param4 = "&rp:AfterNov16="&_AfterNov16
VAR _IsCurrentMonth = 'Accrued Income'[IsCurrentMonth]
VAR _Param5 = "&rp:IsCurrentMonth="&_IsCurrentMonth
VAR _MonthYear = 'Accrued Income'[Month Year]
VAR _Param6 = "&rp:MonthYear="&'Accrued Income'[Month Year]
VAR _PageView = "&rdl:reportview=printview"
VAR _ChromeLess = "&chromeless=true"
VAR _URLtoUse = IF([Measure]="A",_RepURLMultiMonth,_RepURLSingleMonth)
RETURN _URLtoUse&_Param&_Param2&_Param3&_Param4&_Param5&IF([Measure]="A","",_Param6)&_PageView&_ChromeLess
 
The expected behaviour is that when the Measure shows "A" is uses the _RepURLMultiMonth variable, and where it is "B" it uses the _RepURLSingleMonth variable.
 
What is happening is that the URL column is ignoring the measure value when it's "A" and just using the _RepURLSingleMonth variable.
 
I assume this is something the columns context, but I'm not that versed in it.
 
Thank you.
  • Anonymous why you are adding it as a column, why not a measure?

     

     

2 Replies

  • Anonymous why you are adding it as a column, why not a measure?

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      OH MY GOSH!

       

      I've been looking at this for hours now, and I just didn't even think about that.  I should hang my head in shame haha.

       

      Thank you Parry, all working now.