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
srk_powerbi
Helper II
Helper II

Ayuda de cálculo necesaria

Hola

Necesito ayuda osme para calcular una medida.

Tengo debajo de 2 tablas. Ambos están relacionados con AccountNum coulumn. Necesito calcular las medidas para

1. calcular el Count(AccountNum) donde RegisteredDate hoy

2. calcular el Count(AccountNum) donde RegisteredDate - Previous Businessday

3. Calcular la SUMA (Importe) donde RegistradoDate hoy

4. Calcular la SUMA (Importe) donde RegistradoDate - Día de Negocios Anterior

Por favor, ayúdenme. No veo la opción de adjuntar pbix aquí.

tabla 1

AccountnumNombreFecha RegistradaCompletedDate
470093594Jeff11/28/202012/1/2020
470101606Vicky11/30/202011/30/2020
470107112Kevin12/3/2020Null
470099664Peter12/1/202012/2/2020
720109049Victor11/25/2020Null
470108423Rachel11/24/202011/30/2020
470104785Ian12/3/2020Null
470109222Nicky12/2/202012/3/2020
720108958Carl11/29/202012/1/2020

tabla 2

Accountnum Cantidad
470093594 $ 2,000.00
470101606 $ 3,500.00
470107112 $ 800.00
470099664 $ 2,100.00
720109049 $ 1,600.00
470108423 $ 1,730.00
470104785 $ 950.00
470109222 $ 3,800.00
720108958 $ 1,250.00
1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

No @srk_powerbi ,

En función de su descripción, puede crear algunas medidas de la siguiente manera.

count_today : CALCULATE(COUNT('Table 1'[AccountNum]),'Table 1'[RegisteredDate]-TODAY()-1)

count_previous de la casa de los

var x1 á MAXX(FILTER(ALL('Table 1'),[RegisteredDate]<TODAY()-1&&WEEKDAY('Table 1'[RegisteredDate],2)<6),'Table 1'[RegisteredDate])

devolución

CALCULATE(COUNT('Table 1'[AccountNum]),'Tabla 1'[Fecha Registrada]-x1)

sum_today : CALCULATE(SUM('Table 2'[Amount]),'Table 1'[RegisteredDate]-TODAY()-1)

sum_previous de la casa de los 20o (en

var x1 á MAXX(FILTER(ALL('Table 1'),[RegisteredDate]<TODAY()-1&&WEEKDAY('Table 1'[RegisteredDate],2)<6),'Table 1'[RegisteredDate])

devolución

CALCULATE(SUM('Tabla 2'[Importe]),'Tabla 1'[Fecha Registrada]-x1)


Resultado:

v-yuaj-msft_0-1607301166785.png

Espero que eso sea lo que estabas buscando.

Saludos

Yuna

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

3 REPLIES 3
v-yuaj-msft
Community Support
Community Support

No @srk_powerbi ,

En función de su descripción, puede crear algunas medidas de la siguiente manera.

count_today : CALCULATE(COUNT('Table 1'[AccountNum]),'Table 1'[RegisteredDate]-TODAY()-1)

count_previous de la casa de los

var x1 á MAXX(FILTER(ALL('Table 1'),[RegisteredDate]<TODAY()-1&&WEEKDAY('Table 1'[RegisteredDate],2)<6),'Table 1'[RegisteredDate])

devolución

CALCULATE(COUNT('Table 1'[AccountNum]),'Tabla 1'[Fecha Registrada]-x1)

sum_today : CALCULATE(SUM('Table 2'[Amount]),'Table 1'[RegisteredDate]-TODAY()-1)

sum_previous de la casa de los 20o (en

var x1 á MAXX(FILTER(ALL('Table 1'),[RegisteredDate]<TODAY()-1&&WEEKDAY('Table 1'[RegisteredDate],2)<6),'Table 1'[RegisteredDate])

devolución

CALCULATE(SUM('Tabla 2'[Importe]),'Tabla 1'[Fecha Registrada]-x1)


Resultado:

v-yuaj-msft_0-1607301166785.png

Espero que eso sea lo que estabas buscando.

Saludos

Yuna

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Anonymous
Not applicable

Asumo que tiene una tabla calender, intente agregar la siguiente columna:

PrevBusinessdAy á 
	MAXX(
		FILTER('Calendar';' Calendario'[Fecha] < EARLIER('Calendario'[Fecha])
			&& WEEKDAY('Calendario'[Fecha];3) <5); 
		' Calendario'[Fecha] 
        )

A continuación, cree las medidas.

amitchandak
Super User
Super User

@srk_powerbi , Crear una tabla de fechas con las siguientes columnas

Día de trabajo: if(WEEKDAY([Date],2)>-6,0,1)
Fecha de trabajo: if(WEEKDAY([Date],2)>-6,BLANK(),[Date])
Fecha de trabajo Cont á if([Día de trabajo]-0,maxx(FILTER('Date',[Date]<EARLIER([Date]) && [Día de trabajo]<> EARLIER([Work Day]) ),[Date]),[Date])
Fecha de trabajo cont Rango - RANKX(ALL('Date'),[Work Date Cont],,ASC,Dense)

Unirse a ella con la fecha de registro


Este día: CALCULATE(sum('Table'[Amount]), FILTER(ALL('Date'),'Date'[Work Date cont Rank]-max('Date'[Work Date cont Rank])))
El último día de trabajo: CALCULATE(sum('Table'[Amount]), FILTER(ALL('Date'),'Date'[Work Date cont Rank]-max('Date'[Work Date cont Rank])-1))
diff [Este día] - [último día de trabajo]

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.