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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
KBNZ
Regular Visitor

Time Intelligence Functions not working in tables but working in visual

table visual problem.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This is symptomatic of a general problem with current time intelligence functions not performing properly in PBI. The LY calculation is showing in the visual and not in the table. WHY??

 

Something has also happened in general to time intelligence functions as I cannot get simple moving averages calculations to work. 

 

This variable will work properly in a countrows( _period ) calculation producing the corrrect number of rows in a 3 month period.  

VAR _period =
DA
TESINPERIOD(
    DimDate[Date],
    MAX( DimDate[Date] ),
    -3,
    MONTH
)
However when the following calculation is used to calculate months in period the out put is 1 Month instead of 3.
CALCULATE(
    DISTINCTCOUNT(
        DimDate[MonthNumber]
    ),
    _Period
)
 
The model has a dedicated date table with a date hierarchy column and it is properly connected 1 to * relationship with the fact table.
 
I have even tried the moving average in quick measures. That will work in the visual but gives nonsensical gibberish in the table. Whilst the measure works in a visual it disappears when filtered from another visual.

I dont remember these problems occuring before the introduction of the New Visual Calculation feature. 

Any help would be really appreciated.
14 REPLIES 14
Jaywant-Thorat
Super User
Super User

@KBNZ ,

You’re not imagining things — what you’re seeing is a real and explainable shift in how Power BI evaluates measures, especially after Visual Calculations and newer engine optimizations.

Let’s break this down calmly and correctly

  • Never use Month text for time intelligence
  • Always use:
    • Date
    • MonthStartDate
    • YearMonth (YYYYMM)
  • Treat Visual Calculations as cosmetic, not analytical
  • Debug tables first → charts will always work after

=================================================================
Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Jaywant Thorat | MCT | Data Analytics Coach
Linkedin: https://www.linkedin.com/in/jaywantthorat/
Join #MissionPowerBIBharat = https://shorturl.at/5ViW9
#MissionPowerBIBharat
LIVE with Jaywant Thorat from 10 Jan 2026
8 Days | 8 Sessions | 1 hr daily | 100% Free

Thank you for the reply.

The date table being used is very simple.  The date column is being used in the LY calculation.

When applied to a table as in the original example the data is not appearing, yet it is appearing in the bar chart.

It is starting to do my head in to be honest. This use to be a very simple, reliable exercise that is now absorbing unecessary time.

 

Date Table.png

Hi @KBNZ 

In your case Why LY works in chart but NOT in table :  

  • Charts create date context automatically (Axis).
  • Tables do NOT create date context unless a Date column is added.
  • Your LY measure returns BLANK when multiple dates exist.
  • That’s why values appear in bar chart but not in table.

can you try the below steps : 

 

1.In the table visual, add: Date[Date] or Date[YearMonth]
2.Do NOT use the fact table date column.
3.Ensure relationship: Date[Date] → Fact[Date] One-to-many, Active, Single direction.

4.Use this LY measure:

LY :=
CALCULATE (
[Measure],
DATEADD ( 'Date'[Date], -1, YEAR )
)


Hope this helps !!

Thank You.

Thank you, appreciate you looking at this. Unfortunately it is still not working. Please see below. The table is selected and the fields being used can be seen on the right.

 

LY Issue PBi.png

Hi @KBNZ 

Thank you for your continued efforts in troubleshooting this issue. Since we have explored multiple approaches and are still not achieving the expected outcome, I kindly recommend that you raise a support ticket with the Microsoft product team. They will be able to engage with you directly and provide further assistance to help resolve the problem effectively.

 

Power BI Partners | Microsoft Power Platform

Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you for replying. Please see link to download below.

 

Pharmacy Dataset.zip

Hi @KBNZ 

unable to open the file can you share the data as per the below format.

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Hi,

Solved via 2 methods - measures and visual calculations.

Ashish_Mathur_0-1769126897574.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User
Super User

@KBNZ 

do you have the year month column?

try to change the monthnumber to yearmonth

 

CALCULATE(
DISTINCTCOUNT( DimDate[YearMonth] ),
_period
)

 

if this does now work, pls provide some sample data and expected output.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you, tried this and it didnt work. 

Hans-Georg_Puls
Super User
Super User

Hi @KBNZ ,

in your table you calculate the LY revenue for year and month in your column chart you calculate LY revenue for different countries.

  • Whats happens if you do exactly the same calculation in your column chart as in your table?
  • And what happens if you do exactly the same calculation in your table as in your column chart?

Hi Thanks for the interest. The calculation works when the date range is swapped out for country in the table. 

KBNZ_0-1767953523294.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.