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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
GiangLe
Helper I
Helper I

calculate new customers sales only

Hi friends,

I'm working on these 2 datasets which one stores customers information (account number, account status and account opening date), the other stores account information month by month (yearmonth, Account number and Nav (which is sales)).
the 2 datasets connect via an 1-many relationship.

I want to calculate the sales of new customers (base on account opening date) with account status A and P only.

For example, the most recent month (201703), only 3 new customers (6,7,8) but only 7 and 8 have A status so only count of these 2 accounts sales. for month 201702 would  count only sales of account 4 bc account 5's status isnt qualify.
Hope someone can enlighten me on this issue.
Thanks a lots and have a nice day
anh 2.pnganhmoi.png

1 ACCEPTED SOLUTION
GiangLe
Helper I
Helper I

Hi friend,
I managed to did it myself, quite complex Dax, hope it would have others someday
NewNav =
Var
Account = values(PBI_Acc[ACC])
Return
CALCULATE(
Sum('Monthly acc performance'[Sales]),
filter(Account,
CALCULATE(COUNTROWS(PBI_Acc),
FILTER(ALLSELECTED(PBI_Acc[Yearmonth]), PBI_Acc[Yearmonth]< MIN('Monthly acc performance'[Yearmonth]))) = 0),
(PBI_Acc[Status] = "A" || PBI_Acc[Status] = "P")
)

View solution in original post

2 REPLIES 2
GiangLe
Helper I
Helper I

Hi friend,
I managed to did it myself, quite complex Dax, hope it would have others someday
NewNav =
Var
Account = values(PBI_Acc[ACC])
Return
CALCULATE(
Sum('Monthly acc performance'[Sales]),
filter(Account,
CALCULATE(COUNTROWS(PBI_Acc),
FILTER(ALLSELECTED(PBI_Acc[Yearmonth]), PBI_Acc[Yearmonth]< MIN('Monthly acc performance'[Yearmonth]))) = 0),
(PBI_Acc[Status] = "A" || PBI_Acc[Status] = "P")
)

s2anya
Frequent Visitor

Hi  @GiangLe,

 

Can you please copy paste the data set?

 

Regards,

Sanya

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.