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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
alejandroezp
Helper I
Helper I

Problema de fechas en power query

Buenos días,

 

Estoy probaundo a crear una query en Power BI y me responde error.

Mi intención es sacar un conteo de celdas distintas que pertenezcan a un rango de fechas de una tabla. 

Tengo una tabla, la cual se actualiza todos los meses, con una columna que indica la fecha en que se añadió cada fila. Quiero extraer el número de filas que hay dentro de un período de tiempo y que no cuente las filas duplicadas.

Esta es la query que estoy probando:

Total Ventas-S2 = CALCULATE(DISTINCTCOUNT('Ventas'[id]),FILTER('Ventas',('Ventas'[Fecha] = DATESBETWEEN(Calendario[Date],DATE(2023, 1, 1),DATE(2023, 6, 1)))))
 
Saludos
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @alejandroezp 

If your calendar table have the relationship with yourr ventas table,You can try the following measure

Total Ventas-S2 =
CALCULATE (
    DISTINCTCOUNT ( 'Ventas'[id] ),
    DATESBETWEEN ( Calendario[Date], DATE ( 2023, 1, 1 ), DATE ( 2023, 6, 1 ) )
)

Best Regards!

Yolo Zhu

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @alejandroezp 

If your calendar table have the relationship with yourr ventas table,You can try the following measure

Total Ventas-S2 =
CALCULATE (
    DISTINCTCOUNT ( 'Ventas'[id] ),
    DATESBETWEEN ( Calendario[Date], DATE ( 2023, 1, 1 ), DATE ( 2023, 6, 1 ) )
)

Best Regards!

Yolo Zhu

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

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.

Top Solution Authors