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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Feiiiry
Frequent Visitor

semantic model can be refreshed successfully, but the calculation does not work anymore

Hi @PowerBI ,

 

I have a dataflow A in DATA workspace, a semantic model A (connected to this dataflow) also in the DATA workspace.

I created a report connecting to the semantic model A and i published it in the ANALYSIS workspace.

 

I created two new calculated columns in semantic model A. 

I found out that if i publish the semantic model A directly to DATA workspace without refreshing. All my views, measures and calculated columns work perfectly. HOWEVER, if i refresh the semantic model A after publishing it (I can refresh it successfully), the calculated columns i newly created do not work anymore, with the error msg 'The query referenced calculated column '_Table'[Column] which does not hold any data because evaluation of one of the rows caused an error.'

Here is one of the calculated column i created:

IsDateCreatedLastWeek =
VAR CurrentDate = _Table[DATE_OF_CREATION]
VAR LastWeekDates =
    CALCULATETABLE(
        VALUES(dim_date[Date]),
        USERELATIONSHIP(dim_date[Date], _Table[DATE_OF_CREATION]),
        dim_date[Offset ISO Week] = -1 || dim_date[Offset Day] = 0
    )
VAR LastWeekStartDate = FIRSTDATE(LastWeekDates)
VAR LastWeekEndDate = LASTDATE(LastWeekDates)
RETURN
IF(
    CurrentDate >= LastWeekStartDate &&
    CurrentDate <= LastWeekEndDate,
    1,
    0
)


The issue looks soooooooooooo weird to me. Can anyone help me out? Did anyone have teh same issue before? 

Thankssss

2 REPLIES 2
AmiraBedh
Super User
Super User

use TRY to evaluate the CurrentDate and LastWeekDates separately and see if any errors arise.

 

IsDateCreatedLastWeek =
VAR CurrentDate = _Table[DATE_OF_CREATION]
VAR LastWeekDates =
CALCULATETABLE(
VALUES(dim_date[Date]),
USERELATIONSHIP(dim_date[Date], _Table[DATE_OF_CREATION]),
dim_date[Offset ISO Week] = -1 || dim_date[Offset Day] = 0
)
VAR LastWeekStartDate = FIRSTDATE(LastWeekDates)
VAR LastWeekEndDate = LASTDATE(LastWeekDates)
RETURN
IF (
NOT (ISBLANK(CurrentDate)) &&
NOT (ISBLANK(LastWeekStartDate)) &&
NOT (ISBLANK(LastWeekEndDate)) &&
CurrentDate >= LastWeekStartDate &&
CurrentDate <= LastWeekEndDate,
1,
0
)

 

Links to help you :

https://community.fabric.microsoft.com/t5/Power-Query/Query-referenced-calculated-table-which-does-n...

https://community.fabric.microsoft.com/t5/Service/The-query-referenced-calculated-column-Table-Colum...

https://community.fabric.microsoft.com/t5/Service/The-query-referenced-calculated-column-Table-Colum...

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Hi Amira,

 

Thanks for your help! it still doesnt work.

 

i used try and catch, there is no error in the semactic model (when i tried to make a table/bar chart as a test). But it still generates an error 'The query referenced calculated column '_Table'[Column] which does not hold any data because evaluation of one of the rows caused an error.' and / or 'The query referenced column '<oii>LocalDateTable_e1cff804-5c11-409a-b2c2-6ce16587870a6f</oii>'[<oii>Year</oii>] which depends on another column, relationship or measure that is not in a valid state. Additional information: ''.

As long as i dont refresh my semantic model, the calculated columns i created will show/filter everything correctly. Once i refreshed, the same error keeps appearing 😕


So, i just gave up this solution and used another one. It works though not properly ...

 

Thanks again for your help 😉

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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