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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
russtak
Frequent Visitor

Same calculated column in Power Pivot and PBI, different result

Hi All

my table in power pivot is (and the data that I'm expecting....)

DatePrev Date (calculated column)
3/08/1984 
4/08/19843/08/1984
5/08/19844/08/1984
9/08/19845/08/1984
10/08/19849/08/1984

The calculated column's code is

 

=CALCULATE(MAX(Table1[Date]),FILTER(Table1,EARLIER(Table1[Date])>Table1[Date]))

 

 Similar table in Power BI is

DatePrev Date (calculated column)
03/08/1984 
06/08/198403/08/1984
07/08/198406/08/1984
08/08/198407/08/1984
15/08/198414/08/1984

This calculated column code is 

 

Prev Date = CALCULATE(MAX(aord[Date]),FILTER(aord,EARLIER(aord[Date])>aord[Date]))

 

 Why the difference ?

tks Russell

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

Hi @russtak ,
Well, for one thing, the first column is different in the two scenarios. We would really need to see the underlying tables to go further.


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Nathaniel_C
Super User
Super User

Hi @russtak ,
Well, for one thing, the first column is different in the two scenarios. We would really need to see the underlying tables to go further.


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




Hi @Nathaniel_C

The difference in the data in the 'Date' column is irrelevant, I wanted to show that the 'Prev Date' field  for the 5th row in the PBI table  is incorrect should be showing 08/08/1984 and not 14/08/1984. In any case to demo it properly I changed the data in the power pivot query  to align with power bi.

Power Pivot Data below, 5th record shows correct Prev Date as 8/08/1984

 

DatePrev Date
3/08/1984 
6/08/19843/08/1984
7/08/19846/08/1984
8/08/19847/08/1984
15/08/19848/08/1984

Hi @Nathaniel_C 

 

Noob issue my csv data was dodgy, thanks for your help

 

tks R

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors