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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Syndicate_Admin
Administrator
Administrator

Add rows on an invoice

Good morning community,

I've been thinking about a DAX function for a while now that adds all the lines of an invoice, but I can't quite get it.

I put an example in an image, so that everyone understands what I want to calculate.

As always, thank you so much for all your help and support.

Best regards

Imagen suma líneas de factura.png

Jose Luis

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Hello @Syndicate_Admin ,

I finally solved it as follows:

SUMX(VALUES(TABLA[CANTIDAD]),
CALCULATE(MAX(TABLA[PAX])))

Thank you very much for your invaluable collaboration!

Best regards

View solution in original post

7 REPLIES 7
Syndicate_Admin
Administrator
Administrator

Hello @Syndicate_Admin ,

I finally solved it as follows:

SUMX(VALUES(TABLA[CANTIDAD]),
CALCULATE(MAX(TABLA[PAX])))

Thank you very much for your invaluable collaboration!

Best regards

Syndicate_Admin
Administrator
Administrator

I agree. I prepare it and share it.

Thanks again.

Best regards

Syndicate_Admin
Administrator
Administrator

Hello

For confidentiality I can not reproduce the data of my client, but I can simulate them with another image that I attached. It is true that my previous explanation was not correct. Here I explain what I want.Suma pax.png

Thank you very much again.

Best regards

@Syndicate_Admin 

It would be better if you could create a sample data similar to what you have and also provide a desired output. The above attached image is confusing.

 

Regard,

Naveen

Syndicate_Admin
Administrator
Administrator

Hi Naveen,

Thank you so much for responding so quickly.

I had already tried this function but it does not work for me.

Best regards

Please post a sample of data that would be involved in calculation and visual.

NaveenGandhi
Super User
Super User

Hello @Syndicate_Admin 

Try the below Dax.

Total =
CALCULATE (
SUM ( 'Table'[Cantidad] ),
ALLEXCEPT ( 'Table', 'Table'[Factura] )
)
Let me know if this helps!

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!


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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors