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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Tiene sentido agrupar por columna1, pero mostrar columna2 ?

Tengo un Fact Revenue,con 2 dimensiones: Cliente y Categoría.

Tengo los siguientes datos:

CustomerCategoryIngresos YTDIngresos LYTD
xOldCategory(en blanco)150
xNuevaCategoría2000(en blanco)

(En mi pbix tengo el siguiente visual). Solo hay 1 o 2 clientes que han cambiado de categoría; así que para ese caso específico, veo:

CategoryIngresos YTDIngresos LYTD
NuevaCategoría2000(en blanco)

(Esto es correcto, ya que la NewCategory no tiene ingresos para el último año).

But, I don't want to see Ingresos LYTD as blank; is there a way to display Category, but in fact do a group by Customer?... That way, I would be able to display:

CategoryIngresos YTDIngresos LYTD
NuevaCategoría2000150

El código es:

Ingresos YTD:=CALCULATE ( [Ingresos] , DATESYTD('Fecha'[Fecha],"31/05") )

Ingresos LYTD:=CALCULATE ( [Ingresos YTD] , SAMEPERIODLASTYEAR('Fecha'[Fecha]) )

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Allí, @ovonel

Pruebe la siguiente fórmula:

Revenue LYTD =
VAR _lytd =
    CALCULATE ( [Revenue YTD], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
RETURN
    IF ( ISBLANK ( _lytd ), [Revenue YTD], _LYTD )

Si no cumple con su requisito, comparta más detalles.

Saludos
Equipo de soporte de la comunidad _ Eason

Syndicate_Admin
Administrator
Administrator

@ovonel , no está muy claro qué salida desea puede probar los valores

CALCULATE ( [Ingresos] , DATESYTD('Date'[Date],"31/05"), valores (Tabla[Cliente] ))

Ingresos LYTD:=CALCULATE ( [Ingresos YTD] , SAMEPERIODLASTYEAR('Fecha'[Fecha]), valores (Tabla[Cliente] ) )

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors