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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How to use return for multiple values

I have 2 variables already calculated and I need to display them in 2 rows in the same table.
How can I do it?
I used RETURN but it only lets me show a single variable:

for example what I want to do:

VAR number1 = .....
VAR number2 = .....
RETURN number1, number2
 
Thanks,
7 REPLIES 7
Anonymous
Not applicable

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

Anonymous
Not applicable

Good morning, it hasn't worked for me yet.

 

I will explain a little better. What happens is that I have a measure, which results in some names that can vary. The problem is that I need those names to be able to filter another table where I have those names that help me draw a map. In the map table I have latitude, longitude and names. But I have not been able to do it, I have not been able to relate the result of the names of the measures with the names of the map table.

Anonymous
Not applicable

Hi @Anonymous 

Did your name measure based on another table or this map table?

You can try to filter the name of the map table by a slicer. However, we can't build a slicer by a measure, you may need to build a name table by dax and relate this table with map table by name.

Ex:

My sample measure may be like:

 

Measure.Name = CALCULATE(MAX('Table'[Name]),FILTER('Table','Table'[Name]<>"Hawaii"))

 

Build a calculated table :

 

Name = CALCULATETABLE(VALUES('Table'[Name]),FILTER('Table','Table'[Name]<>"Hawaii"))

 

And filter the name of the map table by this slicer.

If this reply still couldn't help you solve your problem, please show me sample tables like yours, and the result you want.

Or you can provide me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

 

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

Anonymous
Not applicable

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

Anonymous
Not applicable

Hi @Anonymous 

One calculated column can only show a single variable.

So if you want to show Number1 and Number2 in two columns, you can build two calculated columns or you can build a new table by addcolumns function.

New Table:

ADDCOLUMNS([Table],"Number1",...,"Number2",...)

If you use Number1 &“ ”& Number2 like Fowmy's reply, your new value will return as value1 value2 (Separated by spaces) in one column.

And the type of your new column will return to text.

 

Best Regards,

Rico Zhou

 

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

PhilipTreacy
Super User
Super User

Hi @Anonymous 

Some previous solutions

https://community.powerbi.com/t5/Desktop/return-multiple-Vars-in-Dax/td-p/411089

https://community.powerbi.com/t5/Desktop/Dynamic-RLS-use-DAX-to-return-multiple-values-IN/td-p/345185

https://community.powerbi.com/t5/Desktop/How-to-return-multiple-values-separated-by-commas-DAX/td-p/912671

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Fowmy
Super User
Super User

@Anonymous 

You have it like:

MeassureName = 

VAR number1 = x 
VAR number2 = y
RETURN
number1 & unichar(10) & number2




 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors