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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
erhan_79
Post Prodigy
Post Prodigy

ayudar a la medida

Hola

Necesito tu apoyo a punto de crear una medida

se puede ver a continuación la regla sobre esa medida

tengo columna de fecha, la medida debe seragrabado en esa columna:

si la columna de fecha es el mes actual escribirá "Mes real"

si la columna de fecha es anterior al mes actual escribirá "Mes anterior"

si la columna de fecha es posterior al mes actual escribirá "Próximo mes"

Muestra:

Mes actual : Septiembre

01.10.2019--Mes anterior

01.05.2020--Mes anterior

01.08.2020-Mes anterior

10.10.2020-Próximo mes

10.01.2021-NMeses

1 ACCEPTED SOLUTION

@erhan_79

Measure = 
    VAR __Min = DATE(YEAR(TODAY()),MONTH(TODAY()),1)
    VAR __Max = EOMONTH(__Min,0)
RETURN
    SWITCH(TRUE(),
        MAX([Date])<__Min,"Previous Month",
        MAX([Date])>__Max,"Next Month",
        "Actual Month"
    )

Pero no puede usar una medida en una segmentación de datos a menos que use el truco de tabla desconectado. En general, para usar una medida de esa manera, debe utilizar el truco de tabla desconectado como se muestra en este artículo: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@erhan_79 , Usted puede probar como

Tipo de mes : Switch( True(),
eomonth(Date[Date],0) á eomonth(Today(),0) ,"Current Month" , //This Month
eomonth(Date[Date],0) < eomonth(Today(),0) && ,"Previous Month" , //last Month
eomonth(Date[Date],0) > eomonth(Today(),0) && ,"Next Month" , //last Month
[Año del mes]
)

O

Sólo un mes

Tipo de mes : Switch( True(),
eomonth(Date[Date],0) á eomonth(Today(),0) ,"Current Month" , //This Month
eomonth(Date[Date],0) á eomonth(Today(),-1) && ,"Previous Month" , //last Month
eomonth(Date[Date],0) á eomonth(Today(),1) && ,"Next Month" , //last Month
[Año del mes]
)

hola @amitchandak

gracias por su respuesta pero, cuando escribo su fórmula después de "emonth" sistema no acepta el nombre de la tabla "fecha[fecha]" , el sistema quiere fecha de inicio como una fecha

@erhan_79 Véase el PBIX adjunto a continuación sig, Tabla (18)

Column = 
    VAR __Min = DATE(YEAR(TODAY()),MONTH(TODAY()),1)
    VAR __Max = EOMONTH(__Min,0)
RETURN
    SWITCH(TRUE(),
        [Date]<__Min,"Previous Month",
        [Date]>__Max,"Next Month",
        "Actual Month"
    )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

gracias @Greg_Deckler

pero quiero crear una mesure su muestra es fórmula dax

¿podría ayudar sobre la medida también

@erhan_79

Measure = 
    VAR __Min = DATE(YEAR(TODAY()),MONTH(TODAY()),1)
    VAR __Max = EOMONTH(__Min,0)
RETURN
    SWITCH(TRUE(),
        MAX([Date])<__Min,"Previous Month",
        MAX([Date])>__Max,"Next Month",
        "Actual Month"
    )

Pero no puede usar una medida en una segmentación de datos a menos que use el truco de tabla desconectado. En general, para usar una medida de esa manera, debe utilizar el truco de tabla desconectado como se muestra en este artículo: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Muchas gracias @Greg_Deckler

esto es lo que quería

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.