Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
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
| Column1 | Quarter |
| Oracle | Q1 |
| Oracle | Q2 |
| Oracle | Q3 |
| SAP | Q1 |
| SAP | Q2 |
| SAP | Q3 |
| Microsoft | Q1 |
| Microsoft | Q2 |
| Microsoft | Q3 |
Hi @Anonymous,
You need a combination of CROSSJOIN and DISTINCT, something like that:
In plain text:
Result =
VAR Quarters = SELECTCOLUMNS ( { "Q1", "Q2", "Q3" }, "Quarter", [Value] )
RETURN
CROSSJOIN ( DISTINCT ( 'Table'[Column1] ), Quarters )Best Regards,
Alexander