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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PaulDBrown
Community Champion
Community Champion

Return values from SLICER from a related table

Hi everyone,

 

I'm hoping for some help with what seems like a simple task. I'm trying to display the values from a related table as selected in a slicer a slicer in a card visual. I'm using CONCATENATEX to account for the instances when more than one item is selected in the slicer. I'm obviously doing something wrong, since the measure I'm using returns all the values; in other words, the measure doesn't work. Here is a graphical representation of the model and the output sought after:

 

 

Related Final.png

 

 

I am expecting the output to be "AAA" if the ITEM slicer has "B" selected.

Can someone point me in the right direction??

 

Thank you!

 

Regards,

 

Paul.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@PaulDBrown

 

Give this a shot

 

Measure =
CALCULATE (
    FIRSTNONBLANK ( Category[Category], 1 ),
    CROSSFILTER ( 'ITEM'[Sub-Category], SubCategory[Sub-Category], BOTH ),
    CROSSFILTER ( SubCategory[Category], Category[Category], BOTH )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@PaulDBrown

 

Give this a shot

 

Measure =
CALCULATE (
    FIRSTNONBLANK ( Category[Category], 1 ),
    CROSSFILTER ( 'ITEM'[Sub-Category], SubCategory[Sub-Category], BOTH ),
    CROSSFILTER ( SubCategory[Category], Category[Category], BOTH )
)

Regards
Zubair

Please try my custom visuals

@Zubair_Muhammad

 

I worked it out! I used CONCATENATEX  in your measure (en lieu of the FIRSTNONBLANK ( Category[Category], 1 ) part and apparently it works (returns multiple values according to the selections in the slice)r.

Just for the benefit of those looking for a similar solution, this is the final measure to cater for multiple selections:

 

Value of Category CONCATENATX = 
CALCULATE (
    CONCATENATEX(Category; Category[Category]; ", ");
    CROSSFILTER ( 'ITEM'[Sub-Category]; SubCategory[Sub-Category]; BOTH );
    CROSSFILTER ( SubCategory[Category]; Category[Category]; BOTH )
)

Thanks again Zubair. I struggled with this for hours!

PS: I'm actually intrigued as to how this would be tackled using RELATEDTABLE, if at all possible, since I was under the impression that the functions RELATED and RELATEDTABLE allowed you to reference a table linked via a one-to-many relationship with another.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@Zubair_MuhammadIt works like a charm! thank you! Is there a way to cater for mutliple selections in the slicer? (that's why I was trying to use CONCATENATEX originally...)

 

 

Thank you again!

Paul.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.