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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

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 2
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.

MFelix
Super User
Super User

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?

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.