Forum Discussion

msmays5's avatar
msmays5
Helper II
6 years ago

Some Values from Disconnected Table Missing in Matrix

Hi all,

 

I have a disconnected table (PeriodCount) with values 0 to 30 in column [PeriodLength], which I have displayed across the columns of a matrix.

 

Additionally, I have a volume table that has hourly data for the latest 24 hours and daily data for the latest 30 days. In this table, there is a column denoting whhether the data is from 24h or 30d.

 

Via a slicer, I control whether I want to display 24h data or 30d data. When I choose the 30d data, all the columns display. However, when I choose 24h, every 3rd column starting at 2 is missing (2, 5, 8, 11, 14, etc.). The numbers look correct for all of the visible [PeriodLength], but I don't understand why every 3rd one is missing.

 

Here is my formula for the measure:

ClosePriceNPeriodsAgo =
VAR PeriodLength = SUM ( PeriodCount[PeriodLength] )
VAR PeriodDivsior= IF ( SELECTEDVALUE ( tblVolume[VolumeType] ) = "24h", 24, 1 )
VAR SubtractTime = PeriodLength / PeriodDivsior
VAR LatestLocalTime = MAX ( tblVolume[LocalTime] )
VAR DesiredTime = LatestLocalTime - SubtractTime
RETURN
CALCULATE (SUM ( tblVolume[closeSharePrice] ), tblVolume[LocalTime] = DesiredTime)

 

Any help would be greatly appreciated.

2 Replies