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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rav999
New Member

Lógica de medida / columna

Hola PBI Gurus,

Quiero crear una Medida que haga esto:

MyOrder$ á CALCULATE( IF( Products[productGroupCode]) á "AB", [GrossOrders$] * 0.7, [GrossOrders$] ))
No funciona ya que la función IF no acepta la tabla de productos. Hay una relación 1:M entre la tabla FactOrders y la tabla Products. Lo que quiero es una medida (o una columna) que muestre el GrossOrder$ que es 30% menos cuando el ProductGroupCode es "AB".
Meaure existente:
GrossOrders$ á CALCULATE( SUM( FactOrders[OrderValue] ))
Thx por adelantado.
Rav
2 REPLIES 2
MFelix
Super User
Super User

Hola @rav999 .

pruebe el siguiente código:

Adjusted = SUMX(Products;IF(Products[ProductsGroupcode] = "AB", [GrossOrders$] * 0.7 , [GrossOrders$]))


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



amitchandak
Super User
Super User

@rav999 , Pruebe uno de los

MyOrder$ á CALCULATE( IF( max(Products[productGroupCode]) á "AB", [GrossOrders$] * 0.7, [GrossOrders$] ))

MyOrder$ á sumx(values(Products[productGroupCode]), IF( max(Products[productGroupCode]) á "AB", [GrossOrders$] * 0.7, [GrossOrders$] ))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.