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
ecs70206
Regular Visitor

dax help with division

hi community

 

 

I need to ask for your help, i have to find out what the spend per passenger is o  my most recent project. I know i need a new calculated column but i dont know how to make the dax work...i am trying to learn but DAX is really HARD 🙂

 

At the moment this is my situation. Ive brought three tables in and created a reference key for the routes. the table in the chart on

the report canvas as shown in the picture shows the spend and the number of passengers on each route alongside the route number. i need to create a column that divides the spend by route by the passenger number to find the spend by passenger by route but i dont know how

 

on my second table i have a column called code. this is linked to the route key on a many to many relationship. each route can take passengers that have different codes I also need to find out the cost per pupil by code.

 

i know this is alot ..but im bamboozled ... i've put as many pictures as i can in to show my situation , any help would be amazing

 

division.pngrelationship.jpgsheet.png

3 REPLIES 3
Greg_Deckler
Super User
Super User

What you likely want are measures, not calculated columns. So, in the first example, you could create a measure like:

 

SpendPerPassenger = SUM([Spend]) / SUM([Passengers])

If you put this measure into your visual, it will be evaluated in context, which means within the context of each row. 

 

For the rest of it, sample data would help but this should get you started down the right path.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

thank you ,

 

I'll give that a go and let you know 

Hi @ecs70206,

 

Could you please tell me if your problem was resolved? Could you please share the answer or mark the proper answer as solution if it's convenient for you? That will be a help to the others.

Best Regards!
Dale

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

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.