cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Return field value from Virtual table (VAR) in measure

Hi,

 

If I'm using virtual table in my measure, what function to display it?

So I have measure like this :

MeasureType =

VAR VirtualTable =
CALCULATETABLE(
ADDCOLUMNS(
            FactInternetSales,
            "GroupType", IF ([Value1] < 10, "Small", "Big")
        ),
        ALLSELECTED( DimDate[Date] )
    )
   
Return ????
 
What should I use in "Return" to display VirtualTable[GroupType]
 
Thanks,
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Return field value from Virtual table (VAR) in measure

Hi @admin_xlsior 

MeasureType =
VAR VirtualTable =
    CALCULATETABLE (
        ADDCOLUMNS (
            FactInternetSales,
            "GroupType", IF ( [Value1] < 10, "Small", "Big" )
        ),
        ALLSELECTED ( DimDate[Date] )
    )
RETURN
    CONCATENATEX ( VirtualTable, [GroupType], ", " )
   

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Return field value from Virtual table (VAR) in measure

Hi @admin_xlsior 

MeasureType =
VAR VirtualTable =
    CALCULATETABLE (
        ADDCOLUMNS (
            FactInternetSales,
            "GroupType", IF ( [Value1] < 10, "Small", "Big" )
        ),
        ALLSELECTED ( DimDate[Date] )
    )
RETURN
    CONCATENATEX ( VirtualTable, [GroupType], ", " )
   

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

Re: Return field value from Virtual table (VAR) in measure

Hi thanks,

but I had to ask why CONCANTENATE ? It is to combine text right?

My expectation for the display result is actualy only 1 word.

 

thanks,

 

Super User
Super User

Re: Return field value from Virtual table (VAR) in measure

It's just to cover for the possibility that there were more than one and avoid errors. In any case, don't worry, the concatenatex will work just as well with only one word

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 395 members 3,525 guests
Please welcome our newest community members: