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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

PAGO SUMA

Hola, tengo algunos problemas tratando de agregar una nueva columna. La siguiente tabla es un ejemplo de los datos que tengo:

TeléfonoLugarTotal de operacionesLos mejores visitadosPagoRegistro
222A5A101/01/20
222A5A202/01/20
222A5A303/01/20
222B5A403/01/20
222C5A403/01/20
224B2B403/01/20
224B2B403/01/20
225B1B403/01/20

Quiero saber cuánto pagó un usuario de teléfono en el primer lugar, por ejemplo el teléfono "222" tiene 5 transacciones (cada fila), 3 lugares visitados y el mejor visitado es el lugar "A". Si utilizo:

Pago: Calculate(SUM(Table1[Payment]),ALLEXCEPT(Table1,[Phone]))


Obtengo para el usuario "222" un pago total de 13. Pero quiero el pago total en el lugar A, eso es 6.

Gracias.

4 REPLIES 4
harshnathani
Community Champion
Community Champion

HOLA @LuisELopez ,

Si desea crear una columna.

Top Place1 =
SUMX (
    FILTER (
        ALL (
            'Table'[Phone],
            'Table'[Place],
            'Table'[Phone],
            'Table'[Payment ]
        ),
        'Table'[Place] = 'Table'[Top visited]
    ),
    'Table'[Payment ]
)

1.jpg

saludos
Harsh Nathani

Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

amitchandak
Super User
Super User

@LuisELopez , creo que usted está tratando de mezclar dos subtotales en un solo lugar.

Sub total de teléfono - >Pago - Calcular(SUM(Table1[Pago]),ALLEXCEPT(Table1,[Teléfono]))

Phone Place Sub Total -> Pago - Calculate(SUM(Table1[Payment]),ALLEXCEPT(Table1,[Phone],[Place]))

En pantalla si desea cambiar sub total consulte

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Anonymous
Not applicable

Hola

Funcionó, gracias.

Pero tengo otro problema, quiero una columna con el subtotal de A para todas las filas.
¿Es posible? Gracias

hola @LuisELopez

Utilice esta fórmula para crear una nueva columna:

Result = CALCULATE(SUM(Table1[Payment]),FILTER(Table1,Table1[Place]=EARLIER(Table1[Top visited])&&Table1[Phone]=EARLIER(Table1[Phone])))

Resultado:

3.JPG

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors