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
admin_xlsior
Post Prodigy
Post Prodigy

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
AlB
Super User
Super User

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
AlB
Super User
Super User

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

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,

 

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
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.