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.
Hello guys, i have a dataset like this and i don`t know how to visualize the total fare of each airlines in the dataset because some customers didn`t pick the same airlines for their travel. (total fare = inbound fare + outbound fare).
Thanks in advance
Solved! Go to Solution.
Hi @Haidannx ,
You need to create two calculated columns:
inb = 'Table'[Inbound fare]*'Table'[number of Adult]
out = 'Table'[Outbound fare]*'Table'[number of Adult]
Then create a calculated table:
Table2 = VALUES('Table'[Outbound airline])
Finally, create the following measure:
in-ou =
VAR _in =
IF (
HASONEVALUE ( 'Table2'[column] ),
CALCULATE (
SUM ( 'Table'[inb] ),
FILTER ( 'Table', 'Table'[Inbound airline] = MIN ( 'Table2'[column] ) )
),
SUMX (
'Table2',
CALCULATE (
SUM ( 'Table'[inb] ),
FILTER ( 'Table', 'Table'[Inbound airline] = MIN ( 'Table2'[column] ) )
)
)
)
VAR _ou =
IF (
HASONEVALUE ( 'Table2'[column] ),
CALCULATE (
SUM ( 'Table'[out] ),
FILTER ( 'Table', 'Table'[Outbound airline] = MIN ( 'Table2'[column] ) )
),
SUMX (
'Table2',
CALCULATE (
SUM ( 'Table'[out] ),
FILTER ( 'Table', 'Table'[Outbound airline] = MIN ( 'Table2'[column] ) )
)
)
)
RETURN
_in + _ou
)
)
Results are as follows:
Here is a demo, please try it:
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Haidannx ,
You need to create two calculated columns:
inb = 'Table'[Inbound fare]*'Table'[number of Adult]
out = 'Table'[Outbound fare]*'Table'[number of Adult]
Then create a calculated table:
Table2 = VALUES('Table'[Outbound airline])
Finally, create the following measure:
in-ou =
VAR _in =
IF (
HASONEVALUE ( 'Table2'[column] ),
CALCULATE (
SUM ( 'Table'[inb] ),
FILTER ( 'Table', 'Table'[Inbound airline] = MIN ( 'Table2'[column] ) )
),
SUMX (
'Table2',
CALCULATE (
SUM ( 'Table'[inb] ),
FILTER ( 'Table', 'Table'[Inbound airline] = MIN ( 'Table2'[column] ) )
)
)
)
VAR _ou =
IF (
HASONEVALUE ( 'Table2'[column] ),
CALCULATE (
SUM ( 'Table'[out] ),
FILTER ( 'Table', 'Table'[Outbound airline] = MIN ( 'Table2'[column] ) )
),
SUMX (
'Table2',
CALCULATE (
SUM ( 'Table'[out] ),
FILTER ( 'Table', 'Table'[Outbound airline] = MIN ( 'Table2'[column] ) )
)
)
)
RETURN
_in + _ou
)
)
Results are as follows:
Here is a demo, please try it:
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thanks alot 😄
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |