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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Gabrielmm
Regular Visitor

Dynamic Comments DAX

How do I show Comments in a measure?

My goal is to dynamically show the value of a column in a text box (or whaterever visual)

 

I have 4 fields with comments

[comment1] [comment2] [comment3] [comment4]

 

and 4 variables

[Level1] [Level2] [Level3] [Level4]

 

I use the levels as slicers, 

let's say I click on [Level1] I want to assign to the measure so it can only show [comment1], not the rest.

 

is this possible?

 

I tried if isfiltered then show values comment1 (or comment2, 3 etc), but didnt work

 

any ideas?

 

I tried if is filtered then values comment1 but didn't work.

1 ACCEPTED SOLUTION

No, it's because VALUES returns multiple values. Which is why it's not called VALUE. A measure has to return a single value for each filtering context. If you're trying to display multiple values from the Commentary1 column for each row, you'll need to use the CONCATENATEX function. If there's only one Commentary1 value for each row you can probably use FIRSTNONBLANK.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Seth_C_Bauer
Community Champion
Community Champion

@Gabrielmm This sounds more like a layout issue. If your column and level are column names you need to unpivot so the data is in rows. Then everything will work as you expect. Here is a screenshot of sample data.

The overall table layout is shown, then i use a slicer and a table to show the filter. The overall table is excluded from the slicer filtering interaction which is why it is not filtered.

 

example2.JPG


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

I'm close to have it working ,It's like this:

 

It's maybe because I have blanks?

No, it's because VALUES returns multiple values. Which is why it's not called VALUE. A measure has to return a single value for each filtering context. If you're trying to display multiple values from the Commentary1 column for each row, you'll need to use the CONCATENATEX function. If there's only one Commentary1 value for each row you can probably use FIRSTNONBLANK.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




There is 1 only comment for each row, FIRSTNONBLANK worked perfectly,Thanks!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.