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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Victormar
Helper V
Helper V

Measure returning multiple values based on slicer selection

Hello community!

I am working on a measure which I would like to return the different values for "expiring contract date" based on a slicer selection for the vehicles in every fleet.

Ideally, the user would select a fleet and then the different expiring dates for each vehicle would show.

 

I have been working with: 

Expiry Date = if(
    ISFILTERED(DIM_Chassis[FLEET]),
    VALUES(DIM_Chassis[CONTRACT_EXPIRING_DATE]),
    blank()
    )
But doesn't work when there are different expiring dates
I think it's not possible, but still want to try.
 
Thanks! 🙂
1 ACCEPTED SOLUTION

@Victormar 

I see. 

 

Caz_16_0-1666276137627.png

 

Caz_16_1-1666276141758.png

 

Does this look ok? In a Matrix visual, I put the "Fleet" at the Primary Row and the "Expiration Date" as the Sub Row. Ive attached my .pbix file at the OneDrive link. Link to OneDrive 

 

I guessed at how your data is formatted. You may be able to put your data into a summary table to get it to behave like this. 

 

View solution in original post

6 REPLIES 6
Victormar
Helper V
Helper V

Hello,

You didn't understand me, I don't want to add the trucks as a row in the matrix, that is my problem to show the different expiring dates.

Ideally I would like to return the different expiring dates from the measure without having to add the trucks, and I am not sure it is possible, something like that:

Victormar_1-1666249332367.png

I am only adding the measures as values in the matrix.

@Victormar 

I see. 

 

Caz_16_0-1666276137627.png

 

Caz_16_1-1666276141758.png

 

Does this look ok? In a Matrix visual, I put the "Fleet" at the Primary Row and the "Expiration Date" as the Sub Row. Ive attached my .pbix file at the OneDrive link. Link to OneDrive 

 

I guessed at how your data is formatted. You may be able to put your data into a summary table to get it to behave like this. 

 

Thanks for the explanation! That helped 😄

Caz_16
Helper II
Helper II

 

Expiriation Date =
IF(
    HASONEVALUE(
        [Fleet]
    ),
    [Expiration Date],
    BlANK()
)

 

 

 

Expiriation Date =
IF(
    COUNTROWS(
        [Fleet]
    ) = 1,
    [Expiration Date],
    BlANK()
)

 

Have you tried HASONEVALUE([Fleet]) or COUNTROWS([Fleet]) = 1? If you put this in the conditional parameter of IF(), then the measure should evaluate when the conditional is TRUE. 

 

Also keep in mind that Measures are designed to return a single value. How you display the measure can alter how the measure behaves. If you want to display this in a table like below, then the above measure should work. 

TruckExp. Date

Truck 1

1/1/22
Truck 24/1/22
Truck 37/1/22

 

Hello, and thanks for the reply 🙂

I have tried but I get this error:

Victormar_0-1666186924863.png

Maybe the problem is that I am using the measures in a matrix as values, so I only show the result of the measures?

 

Not sure from the formulas you shared though, after HASONEVALUE or COUNTROWS, Expiring_Date has to be a measure right? Cannot pass a column there (expiring_date is a column in my dataset).

 

Hope it makes sense 😄

@Victormar 

First https://gprivate.com/61eoy 

Second, for the second parameter of your IF() statement should be a measure that returns the Expiration date of each truck. You can use an aggregate function in your measure such as MIN, MAX, FIRSTNONBLANK, to get the appropriate Expiration date for each truck. The other route to go would be to create a calculated column in the appropriate table. If you go with this method, then IF() can reference a column and return a value. 

 

When creating measures, a great way to troubleshoot what it is doing is to put the measure in a table and add columns to see how the measure is being evaluated in row context. 

 

Hope this helps. 

Caz

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.