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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NumeritasMartin
Frequent Visitor

Return a text value

Hello All,

 

After a little break from PBI I am trying to make a simply dashboard which is mostly working except for the text elements. I want to show the sector of a company, but am either returning an error or the column header as opposed to data. The structure of the table looks as below.

 

The measure I am trying to get to work looks as follows:

 

Sector = VAR SelectedAsset = SELECTEDVALUE('Values'[Asset])
RETURN
   IF(
          ISFILTERED('Values'[Asset]) && NOT(ISBLANK(SelectedAsset)),
          CALCULATE(
          VALUES('Values'[Profile]),
          'Values'[Asset] = SelectedAsset
),BLANK()

)

 

_Measure_Year_Period_Day_Fund_Asset_Profile_Version_Account_Currency_value
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloCompany NameActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloDeal LeaderActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloIndustryActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloSectorActualUndefinedUndefinedText I want to return
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloBusiness Description (Long)ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloHeadquartersActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloGeographyActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloOperationsActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloWebsiteActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloReporting CurrencyActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloStock TickerActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloAcquisition DateActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloAsset StatusActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloBusiness Description (Short)ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloExit multiple of cost - Manager's Current EstimateActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloExpected Exit DateActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloITES - Paragraph 1ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloITES - Paragraph 2ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloITES - Paragraph 3ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloITES - Paragraph 4ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloITES - Paragraph 5ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloITES - Paragraph 6ActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloLead FundActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloLocal CurrencyActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloLocal Currency - ActualActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloLocal Currency - FlashActualUndefinedUndefinedSample data
Meta DataUndefinedUndefinedUndefinedUndefinedCampagnoloNumber of EmployeesActualUndefinedUndefinedSample data
1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @NumeritasMartin ,

Please update the formula of your measure [Sector] as below and check if it can return your expected result...

Sector =
VAR SelectedAsset =
    SELECTEDVALUE ( 'Values'[Asset] )
RETURN
    IF (
        ISFILTERED ( 'Values'[Asset] ) && NOT ( ISBLANK ( SelectedAsset ) ),
        CONCATENATEX (
            FILTER ( 'Values', 'Values'[Asset] = SelectedAsset ),
            'Values'[Profile]
        ),
        BLANK ()
    )

If the above one can't help you get the expected result, please provide some raw data in your table 'Values' (exclude sensitive data) with Text format and your expected result. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @NumeritasMartin ,

Please update the formula of your measure [Sector] as below and check if it can return your expected result...

Sector =
VAR SelectedAsset =
    SELECTEDVALUE ( 'Values'[Asset] )
RETURN
    IF (
        ISFILTERED ( 'Values'[Asset] ) && NOT ( ISBLANK ( SelectedAsset ) ),
        CONCATENATEX (
            FILTER ( 'Values', 'Values'[Asset] = SelectedAsset ),
            'Values'[Profile]
        ),
        BLANK ()
    )

If the above one can't help you get the expected result, please provide some raw data in your table 'Values' (exclude sensitive data) with Text format and your expected result. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

Hi @NumeritasMartin ,

 

The example is not explicit enough can you give some more insights on what you are trying to achieve.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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