Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 Spending =
IF(
SELECTEDVALUE('BAC EAC Data (COBRA)'[FY]) <= [FiscalYear],
BLANK(),
CALCULATE(
SUM(
'Contingency-Funding Profile'[Planned Contingency Spending]
),
'BAC EAC Data (COBRA)'[FY] = MAX('BAC EAC Data (COBRA)'[FY]
)
)
)
The measure [FiscalYear] returns the value "FY22 Q3".
As written, the IF() statement evaluates to false no matter what the 'BAC EAC Data (COBRA)' [FY] value is, even if it is less than the [FiscalYear] value. If I replace [FiscalYear] with a hardcoded value of "FY22 Q3" the code runs as desired and there is no sum calculated for fiscal quarters equal to or before FY22 Q3. I need to have this code be dynamic so that it does not have to be updated each quarter. Is there anyway around this?
Hi, @vsorensen ;
It can be compared with the metric value, but since the metric value changes dynamically; so you can put [FiscalYear] in the table to see if each row returns what is the result?
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@vsorensen your reply is very confusing, you are saying it is a column and at the same time you said here is the expression for the measure?
Could you please read your reply and explain it clearly? Thanks!
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.
I apologize for the confusion
'BAC EAC Data (COBRA)' [FY] is a column and that is what I use for the x-axis in my visual
FiscalYear is a measure that determines the current fiscal year and quarter (i.e. "FY22 Q3")
@vsorensen 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.
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.
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.
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"
)
)
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.