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
101Mathew
Resolver II
Resolver II

DAX - ¿Por qué obtengo 100%

Hola a todos

Estoy empezando a entender DAX más - y tan pronto como creo que estoy llegando allí algo como esto aparece

Necesito mostrar cuánto negocios los corredores de CS han tenido a través del brazo mayorista del negocio. Así que escribí esto (tratando de usar VAR cuando puedo)

CS como % de venta al por mayor - VAR WholesaleAmount ?
CALCULAR (
[T GWP],
FILTRO (
'dDivision, etc',
'dDivision etc'[División] - "Venta al por mayor"
)
)
VAR CSamountInWholesale ?
CALCULAR (
WholesaleAmount,
FILTRO ( dWholesaleBrokers, dWholesaleBrokers[CS/EXT] á "CS" )
)
VAR CSasPerOfWholesale ?
ROUND ( DIVIDE ( CSamountInWholesale, WholesaleAmount ), 4 )
Resultado del VAR : CSasPerOfWholesale
devolución
Resultado
1 ACCEPTED SOLUTION
101Mathew
Resolver II
Resolver II

Hola a todos

en primer lugar gracias @negi007, por su opinión.

Encontré el error en mi DAX. Estaba usando una medida como el valor tomado en, después de reemplazar esto es un cálculo de la tabla de hechos, el siguiente funciona como un encanto.

Mi pregunta ahora es por qué. ¿Esto tiene que ver con la transición de contexto?

Solución al problema original a continuación:

CS como % de venta al por mayor ?
Var WholesaleAmount ?
CALCULAR (
SUM ( fTransactions[GWP] ) + SUM ( fTransactions[FEES] )
+ SUM ( fTransactions[ASS PRODS] )
+ SUM ( fTransactions[LEGAL] ),
FILTER ( 'dDivision etc', 'dDivision etc'[División] - "Venta al por mayor" )
)
VAR CSamountInWholesale ?
CALCULAR (
SUM ( fTransactions[GWP] ) + SUM ( fTransactions[FEES] )
+ SUM ( fTransactions[ASS PRODS] )
+ SUM ( fTransactions[LEGAL] ),
FILTRO ( dWholesaleBrokers, dWholesaleBrokers[CS/EXT] á "CS" )
)
VAR CSasPerOfWholesale ?
ROUND ( DIVIDE ( CSamountInWholesale, WholesaleAmount ), 4 )
Resultado del VAR : CSasPerOfWholesale
devolución
Resultado

View solution in original post

2 REPLIES 2
101Mathew
Resolver II
Resolver II

Hola a todos

en primer lugar gracias @negi007, por su opinión.

Encontré el error en mi DAX. Estaba usando una medida como el valor tomado en, después de reemplazar esto es un cálculo de la tabla de hechos, el siguiente funciona como un encanto.

Mi pregunta ahora es por qué. ¿Esto tiene que ver con la transición de contexto?

Solución al problema original a continuación:

CS como % de venta al por mayor ?
Var WholesaleAmount ?
CALCULAR (
SUM ( fTransactions[GWP] ) + SUM ( fTransactions[FEES] )
+ SUM ( fTransactions[ASS PRODS] )
+ SUM ( fTransactions[LEGAL] ),
FILTER ( 'dDivision etc', 'dDivision etc'[División] - "Venta al por mayor" )
)
VAR CSamountInWholesale ?
CALCULAR (
SUM ( fTransactions[GWP] ) + SUM ( fTransactions[FEES] )
+ SUM ( fTransactions[ASS PRODS] )
+ SUM ( fTransactions[LEGAL] ),
FILTRO ( dWholesaleBrokers, dWholesaleBrokers[CS/EXT] á "CS" )
)
VAR CSasPerOfWholesale ?
ROUND ( DIVIDE ( CSamountInWholesale, WholesaleAmount ), 4 )
Resultado del VAR : CSasPerOfWholesale
devolución
Resultado

negi007
Community Champion
Community Champion

@101Mathew

Puede crear una medida como la siguiente para calcular el porcentaje de contribución de un canal a partir del valor total del negocio

WS% á CALCULATE(SUM('Channel_Contb%'[Value]),'Channel_Contb%'[Channel]'"Wholesale")/CALCULATE(SUM('Channel_Contb%'[Value]),ALLSELECTED('Channel_Contb%'[Channel]))
negi007_0-1600699154590.png




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



Proud to be a Super User!


Follow me on linkedin

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.