cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
KarlaBMS93
Helper I
Helper I

Sumar una Columna filtrada por año y mes

Hola chicos, necesito de su ayuda.

 

Tengo una duda quiero sumar mi columna PSS pero con la condición que la columna CLOSED DATE fuera mayor igual al inicio del mes o que sea Blanco, pero cuando lo quiero filtrar por Año y mes no aparece nada, de hecho cuando filtro no aparece nada y no sé porque, no sé si es porque la relación es secundaria

Esta es mi medida

SUMA_PSS = CALCULATE(

    SUM(CAR_DETAILS[PSS]),

    USERELATIONSHIP(CAR_DETAILS[CLOSED DATE],Calendario[Date]),

    FILTER(

        CAR_DETAILS,

        CAR_DETAILS[CLOSED DATE]>=MIN(Calendario[Date]) || CAR_DETAILS[CLOSED DATE]=BLANK()

    )

)

Aqui les comparto mi archivo: https://www.dropbox.com/s/4tw2c3wsyfobmts/DEPARTAMENTOS.pbix?dl=0

 

 

tabla sin filtrartabla sin filtrartabla con el filtrotabla con el filtro

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

Because you are using USERELATIONSHIP to connect Car_Details table to Calendario table, the filter to look for [Closed Date] >= Calendario[Date] will return ONLY values when your closed date is equal to calendar date.

Looking at your sample data, your closed date and submit date are in Date/Time format. So, you need to use Power Query to extract just a Date Key : https://excelwithallison.blogspot.com/2020/10/datekey-how-to-relate-your-date-data.html

This will still only give you values that are == to the date, so you may also want to remove the USERELATIONSHIP part of your formula, since you're doing the filter with the FILTER function.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

1 REPLY 1
AllisonKennedy
Super User
Super User

Because you are using USERELATIONSHIP to connect Car_Details table to Calendario table, the filter to look for [Closed Date] >= Calendario[Date] will return ONLY values when your closed date is equal to calendar date.

Looking at your sample data, your closed date and submit date are in Date/Time format. So, you need to use Power Query to extract just a Date Key : https://excelwithallison.blogspot.com/2020/10/datekey-how-to-relate-your-date-data.html

This will still only give you values that are == to the date, so you may also want to remove the USERELATIONSHIP part of your formula, since you're doing the filter with the FILTER function.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors