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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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!:
Mastering Power BI 2nd Edition

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.