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
Mahmoodul
Helper I
Helper I

¿Puede cualquiera ayudarme a convertir a continuación el cálculo de Tableau en Power BI DAX

Hola equipo,

puede cualquiera por favor me ayude a convertir este cálculo a continuación tableau en Power BI DAX,

cal.png

Tendencia

IF (ZN([No_of_call]) - LOOKUP(ZN([No_of_call]), -1)) / ABS(LOOKUP(ZN([No_of_call]), -1)) > 0 ENTONCES
'Rojo'
ELSEIF (ZN([No_of_call]) - LOOKUP(ZN([No_of_call]), -1)) / ABS(LOOKUP(ZN([No_of_call]), -1)) - 0 ENTONCES
'Amarillo'
ELSEIF (ZN([No_of_call]) - LOOKUP(ZN([No_of_call]), -1)) / ABS(LOOKUP(ZN([No_of_call]), -1)) < 0 THEN
'Verde'
Final

2 REPLIES 2
amitchandak
Super User
Super User

@Mahmoodul , creo que en la búsqueda tableau se utiliza para buscar la última fila (si el desplazamiento es 1). Power bi a partir de ahora no admite operaciones de fila.

Así que en caso de que necesite tiempo, necesita usar inteligencia de tiempo con tabla de fechas

Ventas MTD: CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
Last MTD Sales - CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

Ventas de QTD: CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales ? CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))

Ventas YTD á CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales á CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únase a ella con la columna de fecha de su hecho/ s. Consulte: https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

Greg_Deckler
Super User
Super User

@Mahmoodul No estoy familiarizado con BUSCAR lo que hace, tal vez FILTER o LOOKUPVALUE? Tampoco está muy familiarizado con la función ZN. Debe ser algo en la línea de esto:

Column =
  VAR __Index = [Index]
  VAR __ZNCall = IF(ISBLANK([No_of_call]),0,[No_of_call])
  VAR __PreviousCall = MAXX(FILTER('Table',__Index - 1),[No_of_call])
  VAR __PreviousZNCall = IF(ISBLANK(__PreviousCall),0,__PreviousCall)
RETURN
  SWITCH(TRUE(),
    (__ZNCall - __PreviousZNCall)/ABS(__PreviousZNCall) > 0,"Red",
    (__ZNCall - __PreviousZNCall)/ABS(__PreviousZNCall) = 0,"Yellow",
    "Green"
  )
    

Podría ser más fácil publicar datos de muestra y salida esperada.


@ 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...

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.