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.

Administrator

Ventas medias excluyendo días en blanco

Hola a todos,

con el cálculo a continuación, pude calcular las ventas diarias promedio como se ve en la pantalla a continuación, pero tendría que ajustar mi cálculo para excluir los días en blanco / cero. ¿Podría por favor ayudar? El resultado esperado es el promedio de los dos valores de la columna "Ventas netas".

Cálculo original:

``````Daily AVG =
VAR selectedDate = SELECTEDVALUE('Date'[Date])

VAR Res = SELECTEDVALUE(Restaurant[Restaurant Name])

RETURN

CALCULATE(SUM('Daily Sales Report'[Net Sales]); MONTH('Date'[Date])=MONTH(selectedDate); YEAR('Date'[Date])=YEAR(selectedDate); Restaurant[Restaurant Name]= Res)/CALCULATE(DISTINCTCOUNT('Date'[Date]);MONTH('Date'[Date])=MONTH(selectedDate); YEAR('Date'[Date])=YEAR(selectedDate); Restaurant[Restaurant Name]= Res;'Daily Sales Report'[Net Sales]>0)``````

Gracias

Tomas

1 ACCEPTED SOLUTION
Administrator
``````Daily Avg =
var selectedDate = SELECTEDVALUE('Date'[Year month])
var result = AVERAGEX( ADDCOLUMNS(
CALCULATETABLE( VALUES( 'Date'[Date]), REMOVEFILTERS('Date'),
'Date'[Year month] = SELECTEDVALUE('Date'[Year month]) ),
"@val", CALCULATE( [Net Sales] ),
[@val])
return result``````
2 REPLIES 2
Administrator
``````Daily Avg =
var selectedDate = SELECTEDVALUE('Date'[Year month])
var result = AVERAGEX( ADDCOLUMNS(
CALCULATETABLE( VALUES( 'Date'[Date]), REMOVEFILTERS('Date'),
'Date'[Year month] = SELECTEDVALUE('Date'[Year month]) ),
"@val", CALCULATE( [Net Sales] ),
[@val])
return result``````
Administrator

¡Gracias, muy apreciado!

Helpful resources

Announcements

New forum boards available in Real-Time Intelligence.

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

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors