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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
alejandroezp
Frequent Visitor

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
v-xinruzhu-msft
Community Support
Community Support

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
v-xinruzhu-msft
Community Support
Community Support

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors