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
Haidannx
Helper I
Helper I

CANT VISUALIZE DATA ON POWERBI

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

1 ACCEPTED SOLUTION
v-joesh-msft
Solution Sage
Solution Sage

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:

41.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ETcG0tSFs0dHj5lo1M... 

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.

 

 

View solution in original post

2 REPLIES 2
v-joesh-msft
Solution Sage
Solution Sage

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:

41.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ETcG0tSFs0dHj5lo1M... 

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 😄

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.