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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
honzafelt
Regular Visitor

First Order Revenue by Date

Hello fellow analysts,

 

I have a this dataset and want to find the revenue coming from the first purchase (the Price column) and plot it on a bar chart by date. I also want to know how much revenue comes from first purchases versus returning purchases every day. Here is how I went about it.

 

Using this formula, I determined the Measure for First Order Revenue.

First Order Revenue = SUMX(
    VALUES(test[UserID]),
    CALCULATE(
        MIN(test[Revenue]), FIRSTDATE(test[Date])
    ))

 

Then I created another Measure for revenue coming from all other orders using this formula.

All Other Revenue = SUM(test[Revenue])-[First Order Revenue]

I can now easily visualise the breakdown of first order revenue vs. returning orders revenue according to user ID.

 

graph.PNG

 

However, I can't see the breakdown of all other revenue vs. first order revenue by date. The chart shows me total revenue instead.

Could you please tell me where have I made the mistake (and what the mistake is)? I have a feeling it has something to do with the structure of the first calculation.

 

graph2.PNG

 

Thank you,

 

Honza

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@honzafelt

 

In your scenario, this "FirstPurchase" is always group on each User Level. When analyzing on Date Level, there's no "FirstPurchase" to each day. For your requirement, I suggest you add a flag column to tag if an entry is FirstPurchase, then put this Flag column into Legend. 

 

IsFirst = IF(test[Date]= CALCULATE(MIN(test[Date]),ALLEXCEPT(test,test[UserID])),"FirstPuchase", "ReturnPurchase"  )

2323.PNG

 

Regards,

View solution in original post

3 REPLIES 3
v-sihou-msft
Employee
Employee

@honzafelt

 

In your scenario, this "FirstPurchase" is always group on each User Level. When analyzing on Date Level, there's no "FirstPurchase" to each day. For your requirement, I suggest you add a flag column to tag if an entry is FirstPurchase, then put this Flag column into Legend. 

 

IsFirst = IF(test[Date]= CALCULATE(MIN(test[Date]),ALLEXCEPT(test,test[UserID])),"FirstPuchase", "ReturnPurchase"  )

2323.PNG

 

Regards,

This is exactly what I needed. Thank you so much, @v-sihou-msft! I've got a long way to go. Smiley Happy

Ashish_Mathur
Super User
Super User

Hi,

 

I am not clear with your question.  Please share the overall objective and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors