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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Table function to assign values to a list

Hi Gurus,

 

I need help to write a calculatetable function to extract unique values of a column and assign a set of values (Q1,Q2,Q3) to each.

 

Example:

 

Table 1:

 

Column1
Oracle

SAP

SAP

Microsoft
Microsoft

Microsoft

 

Result Table

 

Column1Quarter
OracleQ1
OracleQ2
OracleQ3
SAPQ1
SAPQ2
SAPQ3
MicrosoftQ1
MicrosoftQ2
MicrosoftQ3
  
1 REPLY 1
barritown
Super User
Super User

Hi @Anonymous,

You need a combination of CROSSJOIN and DISTINCT, something like that:

barritown_0-1692042747534.png

In plain text:

Result = 
VAR Quarters = SELECTCOLUMNS ( { "Q1", "Q2", "Q3" }, "Quarter", [Value] )
RETURN 
    CROSSJOIN ( DISTINCT ( 'Table'[Column1] ), Quarters )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors