The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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:
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.
Proud to be a Super User!
Paul on Linkedin.
Solved! Go to Solution.
Give this a shot
Measure = CALCULATE ( FIRSTNONBLANK ( Category[Category], 1 ), CROSSFILTER ( 'ITEM'[Sub-Category], SubCategory[Sub-Category], BOTH ), CROSSFILTER ( SubCategory[Category], Category[Category], BOTH ) )
Give this a shot
Measure = CALCULATE ( FIRSTNONBLANK ( Category[Category], 1 ), CROSSFILTER ( 'ITEM'[Sub-Category], SubCategory[Sub-Category], BOTH ), CROSSFILTER ( SubCategory[Category], Category[Category], BOTH ) )
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.
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.
Proud to be a Super User!
Paul on Linkedin.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
94 | |
87 | |
70 | |
65 |
User | Count |
---|---|
244 | |
127 | |
119 | |
81 | |
78 |