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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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