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
hood2media
Resolver I
Resolver I

power query | search all

hi,

i have managed to create a query parameter list called "MainAirport" that will filter 2 columns (i.e. ORIGIN & DEST) using following formula:

= Table.SelectRows( #"Promoted Headers", each [ORIGIN]=MainAirport or [DEST]=MainAirport)

 

however, i'm also trying to find all using following formula but without success:

= Table.SelectRows( #"Promoted Headers", each List.Contains({[ORIGIN], [DEST]}, MainAirport) or MainAirport = "All")

i am testing following DAX formula to calculate the total for diversion for DEST that doesn't produce the correct result -

Dv-Ar =
VAR Airport =
    SELECTEDVALUE( MainAirport[MainAirport] )

RETURN
CALCULATE(
    SUM( Master_Data[DIVERTED] ),
        Master_Data[DEST] = Airport

any help is much appreciated.
tks & kgrdds

 

 

 

 

1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

Dv-Ar =
VAR Airport =
    SELECTEDVALUEMainAirport[MainAirport] )

 

RETURN
CALCULATE(
    SUMMaster_Data[DIVERTED] ),
       FILTER(Master_Data , Master_Data[DEST] = Airport)

@hood2media I hope it's helps you!!

View solution in original post

3 REPLIES 3
Mahesh0016
Super User
Super User

Dv-Ar =
VAR Airport =
    SELECTEDVALUEMainAirport[MainAirport] )

 

RETURN
CALCULATE(
    SUMMaster_Data[DIVERTED] ),
       FILTER(Master_Data , Master_Data[DEST] = Airport)

@hood2media I hope it's helps you!!

hi & tks, @Mahesh0016.

it seems to work!

kindly advise the dax formula to chk for all too i.e. regardless of the ORIGIN and DEST.
krgds, -nik

 

 

hi @Mahesh0016,

i think i hv found the answer for all airports (regardless of the ORIGIN and DEST)-

VAR SelectedAirport =
    SELECTEDVALUE( StnList[StnList] )

RETURN
IF(
    ISBLANK(SelectedAirport),
    CALCULATE(
        SUM( Master_Data[DIVERTED] ),
        ALL( Master_Data )
    ),
    CALCULATE(
        SUM( Master_Data[DIVERTED] ),
        FILTER( Master_Data,
            Master_Data[DEST] = SelectedAirport
        )
    )
)

 

krgds, -nik

 

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.

Top Solution Authors
Top Kudoed Authors