Forum Discussion
The True/False expression does not specify a column. Each True/False expression used as a table
- 2 years ago
Hi atowriss99,
SELECTEDVALUE returns a singular value, which is not compatible as a parameter of KEEPFILTERS. You're probably looking for something like KEEPFILTERS ( 'Date'[Year] = _Year ) or something.
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?) - Anonymous2 years ago
I finally figured it out! I used this:
Full Year C&M Actuals =Calculate([C&M Costs-Actuals],Filter(All('Date'),'Date'[Year]=Year(SELECTEDVALUE('Date'[End of Month]))),USERELATIONSHIP('Date'[Date],'Disconnect Date'[Date]))
I finally figured it out! I used this:
atowriss99,
Awesome, glad you were able to figure it out. 😄
A few suggestions from me:
- Format your measures instead of leaving them all as one continuous line so the code is more readable. Your future self (and other people) will thank you. 😄
- For performance reasons, I believe it's better to keep your _Year variable and use it in your FILTER statement. Variables will calculate only one time if you do.
- I'm guessing you have a Year column in your Date table. You should be able to just use SELECTEDVALUE ( 'Date'[Year] ) instead of capturing the date, then calculating the year from the date.
Maybe something like the below:
Full Year C&M Actuals =
VAR _Year = SELECTEDVALUE ( 'Date'[Year] )
CALCULATE (
[C&M Costs-Actuals],
FILTER (
ALL ( 'Date' ),
'Date'[Year] = _Year
),
USERELATIONSHIP ( 'Date'[Date], 'Disconnect Date'[Date] )
)
Just my thoughts. 😄
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
- Anonymous2 years agoNot applicable
Thanks! I actually went in and cleaned it up already. It helps me trouble shoot when I have it all written out, so I can see/test what piece is incorrect