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.
Good morning,
I'm quite new on DAX so I was wondering if someone can help me solving this issue…
Business: maritime public passenger transportation.
The DB is organized by Booking code that has a sailingcode associated. Every line of this DB is a passenger (a Booking can handle more than one passenger). The diferrent bookings for the same sailing have the same Sailing Code. Another field of this DB is the Ship name associated to the sailing of the booking.
What I'm trying to know is the average number of passanger transported by each ship, in the total of sailings performed in a certain period.
To calculate the total number of passangers in a certain period or from origin x to destination y, we have a measure that count all de bookings that are "CONFIRMED" in the status field.
I've already tried to create a measure with this expression
Ocupação Média por Navio(UnderConst) = AVERAGEX(VALUES(vw_Report_REPLICA_Invoices_Details[VesselName]);SUM(vw_Report_REPLICA_Invoices_Details[NumPassageiros]))
But it didn't worked…
Do you have any ideia what I might be doing wrong?
Thank you,
Solved! Go to Solution.
Hi @SofiaVaz ,
Try the following DAX:
Ocupação Média por Navio(UnderConst) =
AVERAGEX (
ALLEXCEPT (
vw_Report_REPLICA_Invoices_Details;
vw_Report_REPLICA_Invoices_Details[VesselName]
);
SUM ( vw_Report_REPLICA_Invoices_Details[NumPassageiros] )
)
If it doesn't work, you could share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to OneDrive for Business and share the link here.
Hi @SofiaVaz ,
Has your problem been solved? Was my reply helpful to you? If the problem is resolved, you could accept the reply you like.
Hi @SofiaVaz ,
Try the following DAX:
Ocupação Média por Navio(UnderConst) =
AVERAGEX (
ALLEXCEPT (
vw_Report_REPLICA_Invoices_Details;
vw_Report_REPLICA_Invoices_Details[VesselName]
);
SUM ( vw_Report_REPLICA_Invoices_Details[NumPassageiros] )
)
If it doesn't work, you could share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to OneDrive for Business and share the link here.
@SofiaVaz, Try Like
Ocupação Média por Navio(UnderConst) = AVERAGEX(summarize(vw_Report_REPLICA_Invoices_Details;
vw_Report_REPLICA_Invoices_Details[VesselName];"_sum";SUM(vw_Report_REPLICA_Invoices_Details[NumPassageiros]));[_sum])
Hi amitchandak, thank for your help. Unfortunatly this expression output is the same of the one I had before...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |