Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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.
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

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

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

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

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.