Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Victormar
Advocate III
Advocate III

Measure to show specific position of values

Hi all,

I have a measure where I return the name of a fleet whenever a customer or a fleet is selected in a slicer (otherwise blank is returned), like:

 
IF (
    (
        HASONEFILTER ( DIM_Chassis[FLEET_FLEET_ID] )
            || HASONEFILTER ( DIM_Chassis[CONTRACT_CUSTOMER_NAME] )
    )
    ,MAX ( DIM_Chassis[FLEET_FLEET_ID] ),
    ""
)
I wonder if I could return the following value after MAX, in case a Customer with 2 fleets is selected, or the user selects two fleets.
 
Thanks for your support! 😄
5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Use the CONCATENATEX() function.  If it does not help, then share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi!

It's a possibility, although I would like to get different measures for every fleet, so I could visualize them on top of each other, like:

Victormar_0-1673599431185.png

Makes sense?

Thanks for your reply 🙂

Hi @Victormar,

In fact, max function not only work from get the maximum value from table, but it will also dynamic change based on current row context.

You need to add a category/group field to help this formula calculate based on current row context. (for card visual, the row context which measure processed should be match with table level)

Row Context and Filter Context in DAX - SQLBI

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

HI @Victormar,

I think ISFILTERED and HASONEVALUE functions should more suitable for your requirement, you can try to use the following measure formula if helps:

formula =
IF (
    ISFILTERED ( DIM_Chassis[FLEET_FLEET_ID] )
        || ISFILTERED ( DIM_Chassis[CONTRACT_CUSTOMER_NAME] ),
    IF (
        HASONEVALUE ( DIM_Chassis[FLEET_FLEET_ID] ),
        MAX ( DIM_Chassis[FLEET_FLEET_ID] )
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

The problem is that this one would only return the max, and I would like to return a specific position of a fleet. Say the Customer has two fleets, I would like to create different measures for every fleet related to the customer, so perhaps the first measure would return the first fleet, the second the 2nd... and so on...

 

The tricky part is how to tell the measure which position of the fleet to return, if that makes sense? Maybe with a rank or an index?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.