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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
nikkirai99
Frequent Visitor

Error fetching data for this visual - column, relationship or measure not in a valid state

I have a Table 1 which is the main table called 'Main' and Table 2 called 'Reason Codes'. 

Table 1 has 100 rows. Table 2 has 5 rows which match Table 1.

 

My calculated column is below:

If(

     Related('Reason Codes'[ReasonCodeDate])=BLANK(),

     BLANK(),

     Related('Reason Codes'[ReasonCodeDate])
)
Why do I get error message in TEST environment?
Error fetching data for this visual
The query referenced column 'Main'[ReasonCodeDate] which depends on another column, relationship or measure that is not in a valid state.

 

Thank you for your help.

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @nikkirai99  - Your formula itself is correct for what it intends to do, the way the RELATED function works in DAX and the setup of relationships between your tables.there is a one-to-many relationship between Reason Codes (one side) and Main (many side).

 

create simple measure as like below for test:

TestColumn = RELATED('Reason Codes'[ReasonCodeDate])

If this also results in an error, the issue is with the relationship.  still, If the relationship is valid but still causes issues, try an alternative approach using LOOKUPVALUE

 

ReasonCodeDateResolved =
LOOKUPVALUE(
'Reason Codes'[ReasonCodeDate],
'Reason Codes'[ReasonCodeID], 'Main'[ReasonCodeID]
)

 

This formula does not depend on the RELATED function and works even with inactive relationships.Focus on verifying the relationship between the tables and testing the logic with simpler measures.

 





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

Proud to be a Super User!





View solution in original post

4 REPLIES 4
nikkirai99
Frequent Visitor

@rajendraongole1 @danextian Thank you for your responses. It is a known issue for Nov 2024 version:
https://community.fabric.microsoft.com/t5/Issues/Problem-with-November-2024-update-for-PowerBI-Repor.... Nothing has worked for me yet. I'll either wait for the next release or open a support ticket. Thanks again.

Anonymous
Not applicable

Thanks for the reply from danextian  and rajendraongole1 , please allow me to provide another insight:

Hi, @nikkirai99 
 

Thank you for reaching out to the Microsoft Fabric community forum.

 

We appreciate you sharing the issue you encountered and pointing out that it might be a known problem. This information is very helpful for other community members who might be facing similar issues.

 

Additionally, I agree that the alternative solution mentioned by rajendraongole1 is a good idea. You can try using the LOOKUPVALUE() function to temporarily resolve your issue.

vlinyulumsft_0-1736923919006.png

Here is the relevant documentation link:

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

 

Once again, thank you for your contribution. If you have any new discoveries or questions, please feel free to get in touch with us.

 

Best regards,

Leroy Lu

danextian
Super User
Super User

Hi @nikkirai99 

I'm not certain if this is a bug, but I've been encountering it quite frequently lately. My approach is to check if there's a calculated table in the model and add some space at the end. If that's not the issue, I would try renaming the column or refreshing the query.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
rajendraongole1
Super User
Super User

Hi @nikkirai99  - Your formula itself is correct for what it intends to do, the way the RELATED function works in DAX and the setup of relationships between your tables.there is a one-to-many relationship between Reason Codes (one side) and Main (many side).

 

create simple measure as like below for test:

TestColumn = RELATED('Reason Codes'[ReasonCodeDate])

If this also results in an error, the issue is with the relationship.  still, If the relationship is valid but still causes issues, try an alternative approach using LOOKUPVALUE

 

ReasonCodeDateResolved =
LOOKUPVALUE(
'Reason Codes'[ReasonCodeDate],
'Reason Codes'[ReasonCodeID], 'Main'[ReasonCodeID]
)

 

This formula does not depend on the RELATED function and works even with inactive relationships.Focus on verifying the relationship between the tables and testing the logic with simpler measures.

 





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

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.