Hi Fellow Power BI Users -
I am creating a new topic since the previous one was getting confused. I feel like I’ve been running in circles going nowhere
O.k this is the situation I have …
After seeing your video “Secondary Table Logic Inside Of Power BI Using DAX” I understand much better the formula you indicated for having the customers grouped by category.
Total Customers by Category =
CALCULATE( SELECTEDVALUE( 'Customer Grouping'[Customer Category] , BLANK()),
FILTER( ALL( 'Customer Grouping'),
[Months Purchased In 12 months back] >= 'Customer Grouping'[MIN] &&
[Months Purchased In 12 months back] <= 'Customer Grouping'[MAX] ))
It worked perfect and now, I have the customers grouped by the categories I created. The problem I’m still having is the one I mentioned to you in one of my other previous posts and is related to the formula for the counting of months purchased in 12 months back.
Months Purchased In 12 months back = // Number of months that each particular client purchased in within the last 12 months from the date selected.
VAR MonthlySales =
CALCULATETABLE(
SUMMARIZE( 'CALENDAR', 'CALENDAR'[Month & Year], "SalesAmt", [Total Net Sales] ),
DATESINPERIOD( 'CALENDAR'[Date], MIN( 'CALENDAR'[Date] ), -1, YEAR ) )
RETURN
COUNTROWS(
FILTER( MonthlySales, [SalesAmt] > 0 ) )
The idea is having counted the number of months a customer purchased in for the previous 12 months to the period selected but on a monthly basis. In the following example, I’m getting blanks for customers 24 & 25 when I selected the year 2017 when in reality the customer purchased in on that 12 months.
I’ve been expending almost the whole day trying to find the error, but I wasn’t able to be successful …
I know I’m making you wasting so much time with all my questions, but you’re my last hope …
I really appreciate your help…
Lucia