Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
It's quite a basic question but I cannot come out with any solution. I need to calculate numer of new customers in 2020 per department. Additional requirement is that customer is new if he has not had any service delivered for the last 5 years.
So in this case:
Department 2 should have 2 new customers(A and B).
Department 1 should have 3 new customers(because the last time A had something delivered was more than 5 years ago).
The problem that I experience is that my fact table is much bigger and I am running out of memory when I am trying some more demanding calculations ( like this one https://community.powerbi.com/t5/Desktop/new-customers-in-a-selected-period/m-p/307926#M136283 ).
I have also tried to create a measure like that:
#Measure:=COUNTROWS (
FILTER (
ADDCOLUMNS (
VALUES ( Fact[CustomerID] ),
"PreviousDeliveries",
CALCULATE(
COUNTROWS ( Fact),
FILTER(
ALL( Dato),
Dato[Year] <=2020
)
)),
ISBLANK ( [PreviousDeliveries] )
)
)
And then creating a flag on my fact table:
=IF(CALCULATE([#Measure])>0,"Yes","No")
However I could not put it together either.
I am very new to dax so any help would be appreciated.
Thank you in advance!
Hi @Anonymous,
Whether you already got the solution?
Best Regards
Rena
I will prefer to have a column in the table which tells me the last delivery date. Rest can be calculated on top it
Last Deilvery Date = maxx(filter(Fact, Fact[CustomerID]=earlier( Fact[CustomerID]) && Fact[Deilvery Date]<earlier(Fact[Deilvery Date])),Fact[Deilvery Date])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |