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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tecumseh
Resolver II
Resolver II

DAX OFFSET Returns An Error When a Field is changed in the Source

Hi all,

The DAX below works as expected while I use the Net Revenue field.
However if I update all references from Net Revenue to Gross Revenue, I receive an error message:

 

Error Message:
<ccon>OLE DB or ODBC error: Query (28, 13) Despite of MatchBy columns being specified, duplicated rows are encountered in OFFSET's Relation parameter. This is not allowed.

 

Seems odd since I am not changing anything in the OFFSET Parameters in the DAX Formula.
Any thoughts?

Thanks,
w

Test_T01.1 = 
/*
*
*/

VAR T10 =
SELECTCOLUMNS(
SUMMARIZE(
FILTER(
Sales,
Sales[Channel] = "Education" &&
Sales[Advertiser] <> "Accounting Adjustment" &&
Sales[Net Revenue] > 0
),
Sales[Customer],
Sales[Sales Person],
Sales[Date],
"Revenue",[Net Revenue]
),
"Customer", Sales[Customer],
"Sales Person", Sales[Sales Person],
"Date", Sales[Date],
"Revenue", Sales[Net Revenue]
)

VAR T20 =
ADDCOLUMNS(
T10,
"Previous Date",
SELECTCOLUMNS(
OFFSET(
-1,
T10,
ORDERBY([Date], ASC),
PARTITIONBY( [Customer], [Sales Person] ),
MATCHBY( [Customer], [Sales Person], [Date] )
),
[Date]
)
)

RETURN
T20




4 REPLIES 4
Ahmedx
Super User
Super User

Greg Decler is correct in his statement, but nevertheless, share a sample PBIX file so that we can help you

 

Greg_Deckler
Community Champion
Community Champion

@tecumseh There is nothing that OFFSET can do that can't be achieved without it using a simple FILTER statement. I would avoid that function, it often has issues that are almost inexplicable.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler ,

Is there a video or article that you could point me to that achieves the reults I am looking for using the FILTER statement?

Thanks,

w

@tecumseh The last third of this video explores OFFSET pretty in-depth. Starting around the 18 minute mark.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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