rodwhiteley
New Member
- Joined
- Jan 15, 2012
- Messages
- 37
Sorry, DAX newbie here.
I have a biggish dataset (about 4 million rows) and in one column ( [Type] ) there are 42 unique text items ("Item 1","Item 2", ... "Item 42") that I'd like to summarise in a Pivot by date.
My clumsy solution as proof of concept was to create a series of 42 calculated columns in this table along the lines of:
IsItem1
=if([Type]="Item 1",1,0)
Then the next calculated column is
IsItem2
=if([Type]="Item 2",1,0)
etc.
I am then able to Pivot the sums of these columns against the dates, as well as summing them to make compound items (eg "IsItem1or2:=sum([IsItem1],[Item2]) but this seems clumsy and inelegant.
More importantly likely a waste of memory and is probably slowing down performance.
What is the better approach here, or should I just write the 42 extra columns?
Thanks in advance for any help
I have a biggish dataset (about 4 million rows) and in one column ( [Type] ) there are 42 unique text items ("Item 1","Item 2", ... "Item 42") that I'd like to summarise in a Pivot by date.
My clumsy solution as proof of concept was to create a series of 42 calculated columns in this table along the lines of:
IsItem1
=if([Type]="Item 1",1,0)
Then the next calculated column is
IsItem2
=if([Type]="Item 2",1,0)
etc.
I am then able to Pivot the sums of these columns against the dates, as well as summing them to make compound items (eg "IsItem1or2:=sum([IsItem1],[Item2]) but this seems clumsy and inelegant.
More importantly likely a waste of memory and is probably slowing down performance.
What is the better approach here, or should I just write the 42 extra columns?
Thanks in advance for any help