cancel
Showing results for
Did you mean:
Frequent Visitor

## Dynamic column based on slicer selection (calculating conversion rate)

I have a table called Inbound Leads. This has all our leads, their contact, date of origination, source, etc. I also have a TRUE/FALSE column in there for if they have closed or not. I need to create a Combo Bar Chart that shows Count of Inbound Leads by Source and Coversion by Source (For this, I need Closed Leads/All Leads, for each Source).

Here's where it gets tricky, I also need to put a relative date slicer on it. So I can't just create a calculated column because then my date slicer won't work. Also, I want the ability to show a total conversion regardless of source, as a card.

TABLE COLUMNS (example):

A: Name

B: Source

D: Closed? (True/False)

I apologize in advance if this is incredibly simple and I'm just inept!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Dynamic column based on slicer selection (calculating conversion rate)

@cstarr465

try with this modification

```Conversion =
DIVIDE (
COUNTROWS ( FILTER ( Table1; Table1[Closed] = TRUE() ) ),
COUNTROWS ( Table1 )
)```

Lima - Peru

Proud to be a Datanaut!

6 REPLIES 6
Super User

## Re: Dynamic column based on slicer selection (calculating conversion rate)

@cstarr465

Hi, you can use a measure:

```Conversion =
DIVIDE (
COUNTROWS ( FILTER ( Table1; Table1[Closed] = "Yes" ) ),
COUNTROWS ( Table1 )
)```

And in your visual put this:

Let me know if need more help

Regards

Victor

Lima - Peru

Lima - Peru

Proud to be a Datanaut!

Frequent Visitor

## Re: Dynamic column based on slicer selection (calculating conversion rate)

Thanks for the response, I think I'm nearly there!

It returned an error and won't load visuals with the measure: "DAX comparison operations do not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."

Super User

## Re: Dynamic column based on slicer selection (calculating conversion rate)

Hi,

Replace the "Yes" with TRUE.  Does that work?

Frequent Visitor

## Re: Dynamic column based on slicer selection (calculating conversion rate)

Same result. I'm using an IF statement in excel to produce the TRUE/FALSE, do I need to use something else, or a support column?
Highlighted
Super User

Super User

## Re: Dynamic column based on slicer selection (calculating conversion rate)

@cstarr465

try with this modification

```Conversion =
DIVIDE (
COUNTROWS ( FILTER ( Table1; Table1[Closed] = TRUE() ) ),
COUNTROWS ( Table1 )
)```

Lima - Peru