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
Pandadev
Post Prodigy
Post Prodigy

Measure to get base country from max base location

I have a measure to get the max base location for 28 days , which is below , is it possible to adapt the measure so it gets the base country for the max base location.  the column for base country is in the same table , TU feed[Base Country] . Thanks

 

Derived Arrival Base Location 1 - 4 = VAR baseDate_ =
TODAY ()
VAR maxLocationT_ =
TOPN (
1,
ADDCOLUMNS (
DISTINCT ( 'TU Feed'[Arrival Airport] ),
"@LocCount",
CALCULATE (
COUNT ( 'TU Feed'[Arrival Airport] ),
'TU Feed'[runway_departure] >= baseDate_ - 28,
'TU Feed'[runway_departure] < baseDate_ + 1
)
),
[@LocCount], DESC
)
VAR numMaxLocations_ =
COUNTROWS ( maxLocationT_ )
RETURN
IF (
numMaxLocations_ = 1,
IF (
MAXX (
maxLocationT_,
[@LocCount]
) >= 7,
MAXX (
maxLocationT_,
[Arrival Airport]
)
)
)
1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @Pandadev 

Could you share a sample without sensitive data with me by your Onedrive for Business?

Your measure is complex, a sample will make it easier for me to understand your measure.

And you can show me a screenshot of the result you want.

This will make me easier to understand your requirement.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

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.