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.
Hi
I have been trying to filter my data using a date slicer which is linked to a dates table. For the date range selected, I want to then find earliest sales transaction date for each Customer for my calculations.
I looked at various ideas for this and decided to create a MyDate measure to create this and then use it as a filter in my calculated measure. I am getting some unexpected results - when I use the date slicer, the calculation seems to return all information from MyDate and also anything after. When I test using a basic tick box selector, it will filter just on MyDate. Also if I put MyDate in a table it gives the correct date for each customer. I am really confused! Am I missing something in my MyDate code? Any help would be much appreciated!
Solved! Go to Solution.
@WBscooby , Not very clear. Try like, for the amount on the first date for each customer
Measure =
VAR __id = MAX (SalesTransactions[CustomerID] )
VAR __date = CALCULATE ( Min(SalesTransactions[SaleDate] ), ALLSELECTED (SalesTransactions ), SalesTransactions[CustomerID] = __id )
CALCULATE ( COUNT(SalesTransactions[SaleID]), VALUES (SalesTransactions[CustomerID] ),SalesTransactions[ID] = __id,SalesTransactions[SaleDate] = __date,SalesTransactions[NewSale]=1 )
@WBscooby , Not very clear. Try like, for the amount on the first date for each customer
Measure =
VAR __id = MAX (SalesTransactions[CustomerID] )
VAR __date = CALCULATE ( Min(SalesTransactions[SaleDate] ), ALLSELECTED (SalesTransactions ), SalesTransactions[CustomerID] = __id )
CALCULATE ( COUNT(SalesTransactions[SaleID]), VALUES (SalesTransactions[CustomerID] ),SalesTransactions[ID] = __id,SalesTransactions[SaleDate] = __date,SalesTransactions[NewSale]=1 )
This worked brilliantly and a lot simpler! thank you!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |