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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
G3ruso
Frequent Visitor

ASIGNAR UN VALOR SI UN CAMPO TIENE DATOS

Hola a Todos estoy desarrollando un panel con ventas de productos  tengo cuatro productos desde el 2020 y encuentro que el producto A se ha vendido en el 2020 2021 y 2022 el producto B  se vendio en el 2021, el producto C se vendio solo en el 2020 y el producto d se vendio solo en el 2022 tabla productos.png

 necesito una funcion que me permita reconocer  si el produtco se vendio en los tres años en el 2020 ,  2021 o 2022 y los  llame de esta forma 

vivos zombie dormido muerto.png

 

mi tabla original 

 

tabla original.png

 

he intentado con hasonevalue, y con funciones de M  pero estoy un pcoco perdido, agradezco su ayuda

2 REPLIES 2
amitchandak
Super User
Super User

@G3ruso , Try a mea sure or new column

Calculate(distinctcount(Table[Year]), Allexcept(Table, Table[product]))

 

if the column you have to use this on row.

 

You can use Switch to give new meaning to count

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks Amit I tried your solution but this was the result DISTINCTCOUNT.png

 allways was 3 

 

 I tried using sales  the table show values between 3 and 1 but I cannot understand what  these numbers mean

 

thnaks for you orientation

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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