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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
whereismydata
Resolver IV
Resolver IV

Calcular con valor seleced

Hola

puede alguien por favor ayudarme aquí.

[Total] es una medida (una simple Suma (Ingresos) )

Calendario es una tabla de calendario. Existe una relación entre la tabla de calendarios y la tabla de ingresos

Esto funciona:

Total this year = 
VAR vYear = 2020
RETURN
CALCULATE([Total], 'Calendar'[Year] = vYear)

Me da el número correcto

Pero esto no:

Total this year = 
VAR vYear = SELECTEDVALUE('Calendar'[Year])
RETURN
CALCULATE([Total], 'Calendar'[Year] = vYear)

El resultado de esto es (BLANK)

Tengo una segmentación de datos donde el usuario puede seleccionar sólo un año, sin selección múltiple.

Gracias de antemano

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@whereismydata, en primer lugar si están relacionados, entonces

CALCULATE([Total]) debe obtener el filtro

o tratar como

Total este año ?
VAR vYear ? SELECTEDVALUE('Calendar'[Year])
devolución
CALCULATE([Total], filter('Calendar','Calendar'[Year] á vYear))

O


Total este año ?
VAR vYear ? SELECTEDVALUE('Calendar'[Year])
devolución
CALCULATE([Total], filter(all('Calendar'),'Calendar'[Year] á vYear))

View solution in original post

2 REPLIES 2
whereismydata
Resolver IV
Resolver IV

Hola @amitchandak

Estaba usando filter(all ....) antes, pero no funcionó. Lo intenté de nuevo y ahora funciona. Deberías llamarlo un día 😄

Gracias por tomarse el tiempo mirando mi problema!

Mejor

amitchandak
Super User
Super User

@whereismydata, en primer lugar si están relacionados, entonces

CALCULATE([Total]) debe obtener el filtro

o tratar como

Total este año ?
VAR vYear ? SELECTEDVALUE('Calendar'[Year])
devolución
CALCULATE([Total], filter('Calendar','Calendar'[Year] á vYear))

O


Total este año ?
VAR vYear ? SELECTEDVALUE('Calendar'[Year])
devolución
CALCULATE([Total], filter(all('Calendar'),'Calendar'[Year] á vYear))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.