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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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.


Follow on LinkedIn
@ 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors