DrPaulVella
DrPaulVella

Reputation: 449

Google Data Studio convert metric to dimension not working

I have imported my GA4 data into Google Data Studio and am trying to see how many giftcards have been sold by their value.

The item revenue metric in GA4 is equal to the giftcard value (i.e. revenue = $200 therefore $200 giftcard was sold).

I want to breakdown sales by giftcard value like so:

Giftcard (revenue) Count
$200 4
$250 3
$300 6

To do this, I need to set a copy of item revenue as a dimension rather than a metric.

In Google Data Studio, I can create a calculated field with the following formula that should convert the item revenue into text:

CAST(Item Revenue AS TEXT)

The problem I'm having is that while the formula sets the field type as text, it is still regarded by GDS as a metric and can't be used as a dimension.

Even when I try to add text, GDS still recognises the field as a number:

CONCAT(CAST(Item Revenue AS TEXT), " giftcard")

Upvotes: 3

Views: 4065

Answers (1)

Jhw_Trw
Jhw_Trw

Reputation: 162

To use a metric as a dimension you can make a combination of data. When defining the graphic element (table, for example) and the respective data source, just create a data combination, but do not combine the data with any other source and just define the combination with the initial data itself. So you will have the same data structure only through a combined structure.

When making a combination of data, data studio recognizes all calculated fields (metrics) as dimensions. Thus, it is possible to make the conversion.

Upvotes: 2

Related Questions