cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Reply
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!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
Super User IV
Super User IV

@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]
)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Muchas gracias @Greg_Deckler

esto es lo que querรญa

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

secondImage

The largest Power BI virtual conference

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