Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Create a calculated column from two measures

Hello Community  -  I have these two measure, which work perfectly fine.  

 

However, I'm having a bit of challenge using these (or the logic within them) to create a calculated column that would essentially be a toggle between  New  or   Returning Customer.    So, if I wanted to see a column of all new customers, I could easily do so, or likewise if I wanted to see a column of returning customers.   

 

I obviusly need a calculated column to define, at the row level, who is returning, and who is new.   Just not sure how to utilize what I have so far to create this column.   

 

Returning Customers =

VAR _CustomerList = CALCULATETABLE(VALUES(SalesOrdersALL[CustNum_Cust_Seq_Orders]),USERELATIONSHIP('Dim_Date Table'[Date],SalesOrdersALL[Order Date]))

VAR _ReturningCustomers = (CALCULATETABLE(VALUES(SalesOrdersALL[CustNum_Cust_Seq_Orders]),USERELATIONSHIP('Dim_Date Table'[Date],SalesOrdersALL[Order Date]),

(FILTER(ALL('Dim_Date Table'[Date]),

'Dim_Date Table'[Date] > MIN('Dim_Date Table'[Date]) - [Churn Time Frame Value]

&& 'Dim_Date Table'[Date] < MIN('Dim_Date Table'[Date])))))

 

RETURN

COUNTROWS(INTERSECT(_CustomerList,_ReturningCustomers))

 

 

New Customers = //calculating which customers within any particular month have purchased but haven't done so for the last X number of days

VAR _CustomersThisMonth = CALCULATETABLE(VALUES(SalesOrdersALL[CustNum_Cust_Seq_Orders]),USERELATIONSHIP('Dim_Date Table'[Date],SalesOrdersALL[Order Date]))

VAR _PriorCustomers = CALCULATETABLE(VALUES(SalesOrdersALL[CustNum_Cust_Seq_Orders]),USERELATIONSHIP('Dim_Date Table'[Date],SalesOrdersALL[Order Date]),

FILTER(ALL('Dim_Date Table'[Date]),

'Dim_Date Table'[Date] > MIN('Dim_Date Table'[Date]) - [Churn Time Frame Value]

&& 'Dim_Date Table'[Date] < MIN('Dim_Date Table'[Date])))

VAR _NewCustomers = COUNTROWS(EXCEPT(_CustomersThisMonth,_PriorCustomers))

 

RETURN

_NewCustomers

4 REPLIES 4
Anonymous
Not applicable

@lbendlin   Yes, that is clear.   My question is really how can I take the results of the above measures, and create a calculated column from their results.   In another words, a column that list whether a customer is a new or return customer  (based on the results of the measures).     

Hi, @Anonymous 

 

Can you provide a simple PBIX file for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures.

 

Best Regards

You cannot create columns from measures. Convert your measures to calculated columns, do your computations in Power Query, or do them further upstream.

lbendlin
Super User
Super User

You cannot create columns from measures. These concepts (immutable vs mutable) are not reversible.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.