Forum Discussion
vsorensen
4 years agoFrequent Visitor
DAX SELECTVALUE() not recognizing dynamic measure
Hi, I'm having an issue where the value returned by SELECTEDVALUE can be compared to a hardcoded value but not a measure. Below is the code that I've written. Planned Contingency Spendin...
parry2k
Super User
4 years agovsorensen what is the expression for Fiscal Year measure, seems like it is getting evaluated in the row context and the value is changing. Maybe the visual you are using, drop Fiscal Year measure in that visual and check what value you are getting.
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
vsorensen
4 years agoFrequent Visitor
The FiscalYear measure is not in the visual itself. Instead I have a column in the data set called FY and that is in the x-axis.
Here is the code for the FiscalYear measure:
FiscalYear =
VAR CurrentPeriod =
CALCULATE(
MAX('BAC EAC Data (COBRA)'[Date]),
FILTER('BAC EAC Data (COBRA)', 'BAC EAC Data (COBRA)'[ACWP] > 0))
VAR _Month = MONTH(CurrentPeriod)
VAR _Year = RIGHT(YEAR(CurrentPeriod), 2)
RETURN
IF(
_Month >= 10 && _Month <= 12,
"FY" & _Year + 1 & " Q1",
IF(
_Month >= 1 && _Month <= 3,
"FY" & _Year & " Q2",
IF(
_Month >= 4 && _Month <= 6,
"FY" & _Year & " Q3",
"FY" & _Year & " Q4"
)
)
)