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

MEDIDA SUM teniendo en cuenta fechas

Hola!

Necesito sacar unas medidas que a priori tienen que ser fáciles, pero no lo consuigo 😞
Tengo una medida que me calcula el weightd amount por meses (prevision de lo que se cobraría cada mes)
Ahora necesito una medidas:
1.- Suma del weighted amount por meses si la fecha (tengo la columna Month Year) es => al mes de hoy y <2025 (para saber la previsión de ventas desde el mes en curso y para todo el 2024)
2.- Suma del weighted amount total por meses si la fecha es = 2025 (para saber la previsión de ventas para todo el 2025)
1.- Suma del weighted amount total desde el mes de hoy y para 12 meses (para saber la previsión de ventas desde el mes en curso y los siguientes 12 meses)

 

Y que se vaya actualizando segun van pasando los meses.

 

Muchas gracias por vuestra ayuda!!!!

1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Hi, @ElenaCarciLopez 
I create a sample table:

vyohuamsft_1-1714444395772.png

 

You can create measures and try the following DAX expression:

Sum of the weighted amount by months if the date is >equal to the month of today and <2025 = 
CALCULATE(
    SUM('Table'[WeightedAmount]),
    FILTER(
        ALL('Table'),
        'Table'[MonthYear] >= EOMONTH(TODAY(), -1) + 1 && YEAR('Table'[MonthYear]) < 2025
    )
)

 

Sum of the total weighted amount by months if the date is 2025 = 
CALCULATE(
    SUM('Table'[WeightedAmount]),
    FILTER(
        ALL('Table'),
        YEAR('Table'[MonthYear]) = 2025
    )
)

 

Sum of the total weighted amount from today and for 12 months = 
CALCULATE(
    SUM('Table'[WeightedAmount]),
    FILTER(
        ALL('Table'),
        'Table'[MonthYear] >= EOMONTH(TODAY(), -1) + 1 && 'Table'[MonthYear] < EOMONTH(TODAY(), 11) + 1
    )
)

 

Here is my preview:

vyohuamsft_0-1714444370802.png

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

Best Regards

Yongkang Hua

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

3 REPLIES 3

Many thanks for your help! but do you know why it doesn't find my table Date (is where I have my columns with the Month Year info)

ElenaCarciLopez_0-1714467825858.png

 

Hi, @ElenaCarciLopez 

Sorry to reply to you so late.

What I'm providing is my way of thinking, and since I don't have your data, these measures are an example of mine. You may need to modify the measure based on your own data.

Best Regards

Yongkang Hua

v-yohua-msft
Community Support
Community Support

Hi, @ElenaCarciLopez 
I create a sample table:

vyohuamsft_1-1714444395772.png

 

You can create measures and try the following DAX expression:

Sum of the weighted amount by months if the date is >equal to the month of today and <2025 = 
CALCULATE(
    SUM('Table'[WeightedAmount]),
    FILTER(
        ALL('Table'),
        'Table'[MonthYear] >= EOMONTH(TODAY(), -1) + 1 && YEAR('Table'[MonthYear]) < 2025
    )
)

 

Sum of the total weighted amount by months if the date is 2025 = 
CALCULATE(
    SUM('Table'[WeightedAmount]),
    FILTER(
        ALL('Table'),
        YEAR('Table'[MonthYear]) = 2025
    )
)

 

Sum of the total weighted amount from today and for 12 months = 
CALCULATE(
    SUM('Table'[WeightedAmount]),
    FILTER(
        ALL('Table'),
        'Table'[MonthYear] >= EOMONTH(TODAY(), -1) + 1 && 'Table'[MonthYear] < EOMONTH(TODAY(), 11) + 1
    )
)

 

Here is my preview:

vyohuamsft_0-1714444370802.png

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

Best Regards

Yongkang Hua

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

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors