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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Niels_T
Post Patron
Post Patron

Time intelligence not working in column?

Hello,

 

I would like to add a new column with the following code:

 

Stock Niveau =
IF(EOMONTH(MAX('Calendar'[Date]),0) = (EOMONTH(TODAY(),0)),
CALCULATE(SUM('Stock Value'[Cost Amount (Actual)]), ALL('Stock Value')) + [Total Orders] + 'Sales Forecast (GS)'[Sales FC aan COGS]
)
 
I noticed, however, that this doesn't give me any result as it just returns a blank column.
 
When I try this as a measure it does work.
 
Can someone explain why it doesn't work and how I can make it work?
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Niels_T ,

Whether the relationship between your two tables is set to Single.

vyangliumsft_0-1649140122483.png

Result:

vyangliumsft_1-1649140122484.png

You can change its relationship to Both.

vyangliumsft_2-1649140122485.png

Result:

vyangliumsft_3-1649140122486.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi  @Niels_T ,

Whether the relationship between your two tables is set to Single.

vyangliumsft_0-1649140122483.png

Result:

vyangliumsft_1-1649140122484.png

You can change its relationship to Both.

vyangliumsft_2-1649140122485.png

Result:

vyangliumsft_3-1649140122486.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

adrianc2
Regular Visitor

I could be wrong but I think you have added only a "TRUE" condition to your formula. So if in your data the EOMONTH value for the MAX date in your Date column does NOT equal the EOMONTH for the current date, you haven't told Power BI what to do - therefore it returns blank.

 

IF ( 'This is true', 'Do this', 'Otherwise do this')

 

I think you're missing the 'Otherwise do this' part.

 

In summary you need to add a third value to your formula so it knows what calculation to carry out if the EOMONTH value for the MAX date in your calendar does NOT equal hte EOMONTH value for TODAY.

Thanks for the suggestion. I tried it out but I don't think this is the issue. I tested it out with blank().

 

Stock Niveau =
IF(EOMONTH(MAX('Calendar'[Date]),0) = (EOMONTH(TODAY(),0)),
[Total Orders] + 'Sales Forecast (GS)'[Sales FC aan COGS] + CALCULATE(SUM('Stock Value'[Cost Amount (Actual)]), ALL('Stock Value')),
 
BLANK()
)
 
So all months except current month should be blank, but instead all months are blank. So it seems that this particular way of time intelligence is not working?

I was thinking that it could be my relations, but it is just strange that it does work with a measure. 

Do you definitely have data in your dataset for April 2022? Could be the change in months that has thrown it out if you have only data up to and including yesterday (March 2022)

For the sake of not sharing sensitive data I changed the numbers but my table looks something like this:

 

% vs Year%SalesForecast 2022MonthYearNum
20%xxxxxx202201
20%xxxxxx202202
15%xxxxxx202203
10%xxxxxx202204
15%xxxxxx202205
15%xxxxxx202206
15%xxxxxx202207
15%xxxxxx202208
15%xxxxxx202209
10%xxxxxx202210
10%xxxxxx202211
10%xxxxxx202212

 

The MonthYearNum is used to connect to my date table. My date table contains also a column with MonthYearNum. 

 

I don't think this should be a problem for time intelligence right? As I do have a date column with all dates as well.

Instead of MAX how about trying SELECTEDVALUE.

 

So the adapted DAX from the last snippet you sent would be 

Stock Niveau =
IF(EOMONTH(SELECTEDVALUE('Calendar'[Date]),0) = (EOMONTH(TODAY(),0)),
[Total Orders] + 'Sales Forecast (GS)'[Sales FC aan COGS] + CALCULATE(SUM('Stock Value'[Cost Amount (Actual)]), ALL('Stock Value')),
 
BLANK()
)

Stock Niveau = 
IF(EOMONTH(SELECTEDVALUE('Calendar'[Date]),0) = (EOMONTH(TODAY(),0)),
        [Total Orders] + 'Sales Forecast (GS)'[Sales FC aan COGS] + CALCULATE(SUM('Stock Value'[Cost Amount (Actual)]), ALL('Stock Value')), 
        
        BLANK()
        )

I tried it and unfortunately no result 😞

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.