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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Unknowncharacte
Helper III
Helper III

Line Break integrate in current measure

Hello,
I created a list of job titles using quick measure(List of Job Title Values), however, I need it to do a line break after each concatenation, how do I do that? I found unichar(10) might be able to solve this but I cannot seem to integrate it into the current measure. Would someone please help?
Unknowncharacte_1-1698341946813.png

Desired Outcome

Unknowncharacte_0-1698353031742.png

 

Sample Data:

Line Break.pbix


Current Quick Measure:

List of Job Title values =
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('Subjects'[Job Title])
VAR __MAX_VALUES_TO_SHOW = 10
RETURN
    IF(
        __DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
        CONCATENATE(
            CONCATENATEX(
                TOPN(
                    __MAX_VALUES_TO_SHOW,
                    VALUES('Subjects'[Job Title]),
                    'Subjects'[Job Title],
                    ASC
                ),
                'Subjects'[Job Title],
                ", ",
                'Subjects'[Job Title],
                ASC
            ),
            ", etc."
        ),
        CONCATENATEX(
            VALUES('Subjects'[Job Title]),
            'Subjects'[Job Title],
            ", ",
            'Subjects'[Job Title],
            ASC
        )
    )

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Unknowncharacte ,

 

List of Job Title values = 
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('Subjects'[Job Title])
VAR __MAX_VALUES_TO_SHOW = 10
RETURN
	IF(
		__DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
		CONCATENATE(
			CONCATENATEX(
				TOPN(
					__MAX_VALUES_TO_SHOW,
					VALUES('Subjects'[Job Title]),
					'Subjects'[Job Title],
					ASC
				),
				'Subjects'[Job Title],
				", ",
				'Subjects'[Job Title],
				ASC
			),
			", etc."
		),
		CONCATENATEX(
			VALUES('Subjects'[Job Title]),
			'Subjects'[Job Title],
			", "&UNICHAR ( 10 ),
			'Subjects'[Job Title],
			ASC
		)
	)

As shown above what I did was to put in the UNICHAR ( 10 ) which would then put each item on a new line.

Below is what it looks like.

vstephenmsft_0-1698650629501.png

 

Reference: 

DAX – How to get a line break in a DAX measure for Labels or Titles in a Power BI report? - FourMoo ...

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

6 REPLIES 6
v-stephen-msft
Community Support
Community Support

Hi @Unknowncharacte ,

 

List of Job Title values = 
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('Subjects'[Job Title])
VAR __MAX_VALUES_TO_SHOW = 10
RETURN
	IF(
		__DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
		CONCATENATE(
			CONCATENATEX(
				TOPN(
					__MAX_VALUES_TO_SHOW,
					VALUES('Subjects'[Job Title]),
					'Subjects'[Job Title],
					ASC
				),
				'Subjects'[Job Title],
				", ",
				'Subjects'[Job Title],
				ASC
			),
			", etc."
		),
		CONCATENATEX(
			VALUES('Subjects'[Job Title]),
			'Subjects'[Job Title],
			", "&UNICHAR ( 10 ),
			'Subjects'[Job Title],
			ASC
		)
	)

As shown above what I did was to put in the UNICHAR ( 10 ) which would then put each item on a new line.

Below is what it looks like.

vstephenmsft_0-1698650629501.png

 

Reference: 

DAX – How to get a line break in a DAX measure for Labels or Titles in a Power BI report? - FourMoo ...

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Thank you, I was tacking it on in completely wrong places 😬

speedramps
Super User
Super User

speedramps_0-1698343594024.png

 

From this

Unknowncharacte_1-1698352250757.png

To this

Unknowncharacte_0-1698351933455.png

I appologize, I do not know what you mean, there is no blank after A12, CEO is in A13
Titles are all in one cell, separated by a line break and corresponding to the case #

speedramps
Super User
Super User

Why  is A12 followed by a blank? A12 does not have CEO is either table!

where do you see this?

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors