cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
HugoDEVILLIER Regular Visitor
Regular Visitor

Use of one VAR in different tables

Hi, I got different tables in my reports but in each of them I use a calculated column where I create the variable: VAR Version = 787_501.

I will need to change this sometimes, and I would like to know if there is a way to declare a variable in only ONE table, and use it in the others, and if no, is there any way to make something like that?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Use of one VAR in different tables

Is it because, you have quotes in the data itself i.e in version table "787_501" instead of 787_501


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

Proud to be a Datanaut !





View solution in original post

7 REPLIES 7
sturlaws New Contributor
New Contributor

Re: Use of one VAR in different tables

Hi,

 

If I understand you correctly, [Var Version] is a constant. Then you can either have it in a table designated for this constant, or you can add it to just one of the table, and create calculated columns in the other tables like this:

VAR Version = min('Other table'[VAR Version]

cheers,
S

HugoDEVILLIER Regular Visitor
Regular Visitor

Re: Use of one VAR in different tables

You understood perfectly, when I first read your comment , I thought : yes that's it.
BUT Smiley Happy it seem like it doesn't works...
I've created a table "Version" with only one cell called " "787_501" ", 
I've tried just to use your formula and return it to see if it works as intended:
Screen Shot 09-17-19 at 11.48 AM.PNG
And it does... But when I use the formula in my other tables like this:
Screen Shot 09-17-19 at 11.49 AM.PNG

It doesn't works, there is no error but I have a different result from before in my column... I don't understand why.

Thank you for your reply

Super User
Super User

Re: Use of one VAR in different tables

@HugoDEVILLIER It's possible by having a separate table for version and use the "LOOKUPVALUE" funtion in your calculated column logic. 

 

image.png

 

Use the below as your calculated column logic and the value gets updated if you update the version value in the above table.

 

Version = LOOKUPVALUE(Versioning[Version],Versioning[Sno],1)

Let me know if any issues !



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

Proud to be a Datanaut !





HugoDEVILLIER Regular Visitor
Regular Visitor

Re: Use of one VAR in different tables

Thanks for the help!
The formula return the correct value but it seem like it does not work with my filter.. To be more precise, only this part of the formula is working, (so where I do not use the variable).Screen Shot 09-17-19 at 11.49 AM.PNG

 Is there a problem with my way to concatenate ? For example it should write "test 787_501\Development"
When I use: VAR Versions = "787_501" it works , but when I use

VAR Versions = LOOKUPVALUE('Version'[Version];'Version'[Colonne];1) 
which actually returns: "787_501" , I've tested it, it does not works...
sturlaws New Contributor
New Contributor

Re: Use of one VAR in different tables

@HugoDEVILLIER,

 

have you tried without the quotes around 787_501?

 

-s

Super User
Super User

Re: Use of one VAR in different tables

Is it because, you have quotes in the data itself i.e in version table "787_501" instead of 787_501


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

Proud to be a Datanaut !





View solution in original post

HugoDEVILLIER Regular Visitor
Regular Visitor

Re: Use of one VAR in different tables

I was sure I tried with and without quotes... It look like I was wrong, it works...
Thank you very much to you and @sturlaws !

Helpful resources

Announcements
New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (3,590)