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
Syndicate_Admin
Administrator
Administrator

Identify minimum date and assign it to records with the same Internal Number

Good morning.

I would like to generate some DAX that allows me to identify the minimum date within the "Accountingdate" field as long as the voucher is V and the Internal Number is the same. In the example:

For the internal number C-ME-00000091 the minimum accounting date within the V vouchers is 02/06/2021 (red in image)

For the internal number C-ME-00000117 the minimum countable date within the vouchers V is 02/06/2021 (blue in image)

jmdaher_0-1660663032914.png

I hope it is understood and whoever has any solution, can help me.

Thank you very much.

1 ACCEPTED SOLUTION

Hi again. 

Sorry you're right.

 

try this measure: 

Fecha min = 
var _numero = SELECTEDVALUE('Table'[Numero interno])
var _value = 
    CALCULATE(
        MIN('Table'[Fechacontable]),
        filter(all('Table'),'Table'[Numero interno]=_numero && 'Table'[comprobante] = "V")
    )
return 
_value

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! ;-
Best Regards
BC

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


View solution in original post

7 REPLIES 7
Syndicate_Admin
Administrator
Administrator

Excellent! It worked, thank you so much for your help!

onurbmiguel_
Super User
Super User

Hello 

Try this measure: 

 

Fecha Min = 
CALCULATE(
    min('Table'[Fechacontable]),
    GROUPBY('Table','Table'[Numero interno],'Table'[Comprobante]),
    'Table'[Comprobante]="V"
)

onurbmiguel__0-1660664040443.png

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! ;-
Best Regards
BC

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


It's a great approximation, but I was looking for this:

jmdaher_0-1660665046961.png

That each record contains the date min. With the measure introduced, it gives me the same date as the Accounting date. To the right of the Date min column, I placed what I'm looking to get to.

Best regards.

Hi again. 

Sorry you're right.

 

try this measure: 

Fecha min = 
var _numero = SELECTEDVALUE('Table'[Numero interno])
var _value = 
    CALCULATE(
        MIN('Table'[Fechacontable]),
        filter(all('Table'),'Table'[Numero interno]=_numero && 'Table'[comprobante] = "V")
    )
return 
_value

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! ;-
Best Regards
BC

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Excellent! It worked, thank you so much for your help!

Hello 

Please accept my solution and and give me kudos if possible.

 

thanks 

Bruno 

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Hello Bruno!

I believe that the solution has already been accepted. I'm new to the platform.

And congratulations are given from where?

Best regards.

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.