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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Diference Between Second and First Order

Hello!

I'm trying to find the difference between the second and first client order.

Through two measures, I was able to find such dates and the difference between them:

2nd order =
VAR temp =
ADDCOLUMNs(
VALUES ( Total[Document Date] ),
"RANK", RANKX (
VALUES ( Total[Document Date] ),
[Document Date], ,
ASC,
DENSE
)
)
RETURN
MINX ( FILTER ( temp, [RANK] = 2 ), [Document Date] )
 
However, when I put this in a table, PowerBi does not calculate such numbers:
 
 

Erro PowerBi.png

 

How can I turn around this?

It is better to create a new column with the date of the second order? How can I do this?

 

Tks in advance!
Lucas

 

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Do you want to return the value of subtotal? Please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

littlemojopuppy
Community Champion
Community Champion

Hi @Anonymous 

 

Generally speaking, not a good idea to add columns.  This isn't terrible to do in a measure.  Can you provide some sample raw data to work with?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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