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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Basmall_B
Frequent Visitor

Want to create a measure not a column with related values pulled from different tables

Hi 

I am making my transition from sql to DAX and is in the process of learning DAX syntax.

What I would like to do is to create  measure to show concatenated values from two different tables which are related from an Analysis server tabular model. The measure will show as a column in my table visual.  Adding a custom calculated column is not an option as I dont have rights to make changes to the Tabular model. 

I dont need this be done for all rows only for rows that have a data type "WaterQuality" 

Please see the attached sample table and data model

 

Here is what i am trying to achieve. select from table1 column, table 2 column  concat those columns based on a filter column in table 3 where data category = 'Water Quality'

 

Thank you for help in advance

SampleTable.png

Model.jpg

 

 

 

1 ACCEPTED SOLUTION

Wow thank you very much it works. I am almost close to the final desired output.

This is  what I ended up doing for a Measure

 

LocationSamples =
(
VAR SampleNames = CALCULATE ( VALUES ( DIMSAMPLENAME[SampleName] ), Fact_Readings )
VAR Locations = CALCULATE ( VALUES ( DimIntervals[INTERVAL_NAME] ), Fact_Readings )
Return
CONCATENATE( Locations, SampleNames)
)

 

I want to add a space or  comma using concatenate  in between the location and sample names and the visual comes up empty 

when I  nest the concatenate

 

CONCATENATE(Locations, CONCATENATE(", ", SampleNames))

 

I even tried "& &" since both the variables are returning strings . The version of powerbi that we have that is compatible with or OnPerm server doesnt have the new COMBINEVALUES function

Locations&" , "&SamplesNames

 

What am I missing here?

 

 

 

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

Hi, @Basmall_B , based on your description and illustration, I'd obtain filtered columns this way,

SampleNames Filtered = CALCULATE ( VALUES ( DIMSAMPLENAME[SampleName] ), Fact_Readings )

Locations Filtered = CALCULATE ( VALUES ( DimLocation[LOCNAME] ), Fact_Readings )

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Wow thank you very much it works. I am almost close to the final desired output.

This is  what I ended up doing for a Measure

 

LocationSamples =
(
VAR SampleNames = CALCULATE ( VALUES ( DIMSAMPLENAME[SampleName] ), Fact_Readings )
VAR Locations = CALCULATE ( VALUES ( DimIntervals[INTERVAL_NAME] ), Fact_Readings )
Return
CONCATENATE( Locations, SampleNames)
)

 

I want to add a space or  comma using concatenate  in between the location and sample names and the visual comes up empty 

when I  nest the concatenate

 

CONCATENATE(Locations, CONCATENATE(", ", SampleNames))

 

I even tried "& &" since both the variables are returning strings . The version of powerbi that we have that is compatible with or OnPerm server doesnt have the new COMBINEVALUES function

Locations&" , "&SamplesNames

 

What am I missing here?

 

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.