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
kwonsok
Frequent Visitor

LOD Expressions from Tableau

Hi,

 

I am trying to calculate the first purchase date of a given customer.

 

 

 

Each row has a customer ID and a purchase date, leading two a structure with multiple rows that have the same customer ID with different purchase dates.

 

In Tableau, I used the "Fixed" function, but this function does not seem to exist in Power BI.

 

I've also tried what this post mentions, but the expression used in this post returns the first purchase date for ALL customer ID's for me.

 

https://dataveld.com/2018/02/17/tableau-to-power-bi-fixed-lod-expressions/

 

Any help would be appreciated.

 

Thanks.

1 ACCEPTED SOLUTION
Thejeswar
Resident Rockstar
Resident Rockstar

Hi @kwonsok,

You can use the below DAX statement in a calculated column for achieving your need. (You can modify this DAX as per your need)

 

Column = CALCULATE(MIN('Table1'[Datetime]), FILTER('Table1', 'Table1'[ID] = EARLIER('Table1'[ID])))

Capture.PNG

 

 

 

The Above Screenshot shows the value after using DAX statement in the "Column" column values

Hope this helps!!!

View solution in original post

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @kwonsok,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi this is very helpful,

 

but is there a way to show distinct values, I am trying to do something similar to this function but i need to sum the distinct values.

 

for example my data set looks like this

 

ID User Count    items

1     100               A

1     100               B

1     100               C

1     100               D

 

I need the formula to output

ID User Count

1     100

 

and so on for all of the IDs

Thejeswar
Resident Rockstar
Resident Rockstar

Hi @kwonsok,

You can use the below DAX statement in a calculated column for achieving your need. (You can modify this DAX as per your need)

 

Column = CALCULATE(MIN('Table1'[Datetime]), FILTER('Table1', 'Table1'[ID] = EARLIER('Table1'[ID])))

Capture.PNG

 

 

 

The Above Screenshot shows the value after using DAX statement in the "Column" column values

Hope this helps!!!

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.