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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
fav_ccc2021
Helper I
Helper I

Crear conteo unico de un registro con power query

Hola a todos

les pido su ayuda para crear un conteo de registros unicos  con power query contando la primera vez que aparece y luego dejarlo en ceros.

 

un ejemplo

fav_ccc2021_0-1747934862211.png

 

Desde ya muchas gracias!!

 

Saludos 

1 ACCEPTED SOLUTION

Hi @fav_ccc2021 ,

Thank you for your response.  The @Irwan , suggestion is correct you can add an additional criterion to ensure the DAX logic works properly. Based on your description, it seems the current approach only considers ID.

To refine the count and avoid duplication, you might need to consider both ID and ACTIVIDAD when identifying the max date. Could you share a sample dataset showing cases where the record appears more than once for the same date? This would help tailor the solution to your needs.

 

Regards,
Yugandhar.

View solution in original post

8 REPLIES 8
V-yubandi-msft
Community Support
Community Support

Hi @fav_ccc2021 ,

Following up to check whether you got a chance to review the suggestion given.If it helps,consider accepting it as solution,it will be helpful for other members of the community who have similar problems as yours to solve it faster. Glad to help. 

Thank You.

V-yubandi-msft
Community Support
Community Support

Hi @fav_ccc2021 ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @fav_ccc2021 ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

V-yubandi-msft
Community Support
Community Support

@fav_ccc2021 ,

Thanks for reaching out to the Microsoft Fabric Community.

I’ve tested the solution shared by @Irwan , and it works perfectly it meets your requirements as described. If you need any additional details or further assistance, feel free to let us know.

FYI:

Vyubandimsft_0-1747985888663.png

 

Special thanks to @Irwan  for your valuable contribution to the community.

 

If your issue is resolved, please consider marking the response as the Accepted Solution to help others facing a similar issue find it more easily.

Hola, muchas gracias por la ayuda,  el problema que tengo es que tengo el registro mas de una vez para la misma fecha, entonces lo cuenta en ambas con un 1. Es posible agregar otro criterio para que respete  el conteo?

 

Desde ya muchas gracias!

Hi @fav_ccc2021 ,

Thank you for your response.  The @Irwan , suggestion is correct you can add an additional criterion to ensure the DAX logic works properly. Based on your description, it seems the current approach only considers ID.

To refine the count and avoid duplication, you might need to consider both ID and ACTIVIDAD when identifying the max date. Could you share a sample dataset showing cases where the record appears more than once for the same date? This would help tailor the solution to your needs.

 

Regards,
Yugandhar.

hello @fav_ccc2021 

 

i dont speak spanish so i use google translate

Hello, thank you very much for the help. The problem I have is that I have the record more than once for the same date, so it counts it as 1 in both. Is it possible to add another criterion to respect the count? Thank you in advance!

 

you absolutely can add another criteria to make sure the DAX works as intended.

But looking at your expected result, the criteria only the ID as far as i can tell. For the same ID, you want to get the max date.

You can add another value for example, get max date for the same ID AND same ACTIVIDAD.

 

otherwise, please share a sample data about "the record more than once for same date" as you mentioned above.


Thank you.

Irwan
Super User
Super User

hello @fav_ccc2021 

 

please check if this accomodate your need.

Irwan_0-1747953801859.png

create a new calculated column with following DAX. 

CUENTA =
var _MaxDate =
CALCULATE(
    MAX('Table'[FECHA]),
    ALLEXCEPT('Table','Table'[ID])
)
Return
IF(
    'Table'[FECHA]=_MaxDate,
    1,
    0
)
after the column is created, then you can count the value in that column.

Hope this will help.
Thank you.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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