Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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