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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.