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

Measure not being filtered in by connected table

Good morning everyone,

 

I hope everyone is staying healthy and safe during these times.

 

I have a problem that I've been working on for a few days and can't seem to figure out. A few months ago I posted here about having a value extend forwards but not backwards. (Link here)

 

It worked amazingly! However, recently I cleaned up a table that is connected to the table this measure references. now it no longer filters the formula below.  I confirmed the model connections are right by doing a join.

 

Here is the code:

Predicted Budget =
VAR _curval =
CALCULATE(
SUM('Predictive Financial Data'[Total Notional Budget (A = B + C)]),
FILTER(
'Predictive Financial Data',
'Predictive Financial Data'[Accuracy Date] = MAX('Calendar Table'[Date])
)
)

VAR _maxdate =
CALCULATE(MAX('Predictive Financial Data'[Accuracy Date]), ALL('Predictive Financial Data'))

VAR _foreval =
CALCULATE(
SUM('Predictive Financial Data'[Total Notional Budget (A = B + C)]),
FILTER(ALL('Predictive Financial Data'), 'Predictive Financial Data'[Accuracy Date] = _maxdate)
)
 
RETURN
IF(MAX('Calendar Table'[Date]) <= _maxdate, _curval, _foreval)
 
Any help anyone can provide would be greatly appreciated.
 
Thanks in advance,
 
Vanlang
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Never mind, I solved it. 🙂

 

I had to alter the code to the following:

 

Predicted Budget =
VAR _curval =
CALCULATE(
SUM('Predictive Financial Data'[Total Notional Budget (A = B + C)]),
FILTER(
'Predictive Financial Data',
'Predictive Financial Data'[Accuracy Date] = MAX('Predictive Financial Data'[Accuracy Date])
 
)
)

VAR _maxdate =
CALCULATE(MAX('Predictive Financial Data'[Accuracy Date]), ALL('Predictive Financial Data'))

VAR _foreval =
CALCULATE(
SUM('Predictive Financial Data'[Total Notional Budget (A = B + C)]),
//FILTER(ALL('Predictive Financial Data'), 'Predictive Financial Data'[Accuracy Date] = _maxdate)
FILTER(
'Predictive Financial Data',
'Predictive Financial Data'[Accuracy Date] = MAX('Predictive Financial Data'[Accuracy Date])
))

RETURN
IF(MAX('Calendar Table'[Date]) = _maxdate, _curval,
IF(MAX('Calendar Table'[Date]) < _maxdate, BLANK(),
_foreval)
)

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Never mind, I solved it. 🙂

 

I had to alter the code to the following:

 

Predicted Budget =
VAR _curval =
CALCULATE(
SUM('Predictive Financial Data'[Total Notional Budget (A = B + C)]),
FILTER(
'Predictive Financial Data',
'Predictive Financial Data'[Accuracy Date] = MAX('Predictive Financial Data'[Accuracy Date])
 
)
)

VAR _maxdate =
CALCULATE(MAX('Predictive Financial Data'[Accuracy Date]), ALL('Predictive Financial Data'))

VAR _foreval =
CALCULATE(
SUM('Predictive Financial Data'[Total Notional Budget (A = B + C)]),
//FILTER(ALL('Predictive Financial Data'), 'Predictive Financial Data'[Accuracy Date] = _maxdate)
FILTER(
'Predictive Financial Data',
'Predictive Financial Data'[Accuracy Date] = MAX('Predictive Financial Data'[Accuracy Date])
))

RETURN
IF(MAX('Calendar Table'[Date]) = _maxdate, _curval,
IF(MAX('Calendar Table'[Date]) < _maxdate, BLANK(),
_foreval)
)

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.