Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Column ' ' in table 'source_data_view' cannot be found or may not be used in this expression

Hello - 

 

I am trying to create a calculated field that calculates the difference between a partner's rank this week against their rank the previous week.

 

The main formula below:

 

Trend_Rank_Performing_Partners_Direction =
VAR minDate = MIN('Calendar'[Date].[Date])
VAR maxDate = MAX('Calendar'[Date].[Date])

 

VAR minRankPrev =
CALCULATE(
MAX('source_data_view'[Trend_Rank_Previous_Week]),'Calendar'[Date] = minDate )

 

VAR maxRank =
CALCULATE(
MAX('source_data_view'[Trend_Rank]),'Calendar'[Date] = maxDate)

 

RETURN maxRank - minRankPrev

 

However, I am getting an error that says: Column 'Trend_Rank_Previous_Week' in table 'source_data_view' cannot be found or may not be used in this expression.

 

Here is the calculated measure formula for Trend_Rank_Previous_Week:

 

Trend_Rank_Previous_Week =
 
VAR CURRENTWEEK = SELECTEDVALUE('Calendar'[Week of Year])
VAR CURRENTYEAR = SELECTEDVALUE('Calendar'[Year])
VAR MAXWEEKNUMBER = CALCULATE(MAX('Calendar'[Week of Year]), ALL('Calendar'))

RETURN
 
CALCULATE([Trend_Rank],
FILTER(ALL('Calendar'),
IF(CURRENTWEEK = 1,
'Calendar'[Week of Year] = MAXWEEKNUMBER && 'Calendar'[Year] = CURRENTYEAR - 1,
'Calendar'[Week of Year] = CURRENTWEEK - 1 && 'Calendar'[Year] = CURRENTYEAR)))
 
 
And for Trend_Rank, it's the following:
 
Trend_Rank = IF(NOT(ISBLANK([Sum_Total_Action_Count])),RANKX(ALL('source_data_view'[partner_display_name]),[Sum_Total_Action_Count],,0),BLANK())

 

Any help or suggestions would be greatly appreciated!

2 Replies

  • Hi Anonymous ,

     

    Are this calculations measures or columns? Appears to me that you are maknig a calculated column trying to use a measure, and so the calculation does not return correct result.

     

    Are you abble to share a sample file?

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    So is it column or measure for Trend_Rank_Previous_Week? You should use measure but seems you created a column for it?

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.