Forum Discussion
Create a calculated row
I have a "User registration date" and "product purchase date" in my dataset...
Simply what I want to do is; when I change date range in slicer, how many of them have become members between these dates (new member)
I cannot create DAX or advanced queries since I have just started using PowerBI and I am not a developer :) Is there anyone who can help me to create measure I need? :(
hi, Anonymous
Use DISTINCTCOUNT in the formula
Result 3 = var _fromdate=CALCULATE(MIN(Sheet1[New Transaction Date]),ALLSELECTED(Sheet1)) var _enddate=CALCULATE(MAX(Sheet1[New Transaction Date]),ALLSELECTED(Sheet1)) return CALCULATE ( DISTINCTCOUNT( Sheet1[WalletID] ), FILTER ( Sheet1 , Sheet1[New Wallet Createddate] >= _fromdate && Sheet1[New Wallet Createddate] <= _enddate ) )Regards,
Lin
13 Replies
- MariuszCommunity Champion
- AnonymousNot applicable
I dont know how to add it, therefore I shared in link below.
- MariuszCommunity Champion
- AnonymousNot applicable
According to dataset;
Transaction Date= purchase date
Wallet Createddate= membership date
- MariuszCommunity Champion
Hi Anonymous
I've attached the file with the solution.
You will need to create a calendar table / date dimension with one active and one inactive relationship to achieve this.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
- v-lili6-msftCommunity Support
hi, Anonymous
Just adjust the formula as below:
Result 3 = var _fromdate=CALCULATE(MIN(Sheet1[New Transaction Date]),ALLSELECTED(Sheet1)) var _enddate=CALCULATE(MAX(Sheet1[New Transaction Date]),ALLSELECTED(Sheet1)) return CALCULATE ( COUNTA ( Sheet1[WalletID] ), FILTER ( Sheet1 , Sheet1[New Wallet Createddate] >= _fromdate && Sheet1[New Wallet Createddate] <= _enddate ) )Regards,
Lin
- AnonymousNot applicable
Logic is correct, finally I got what I need. I need your help on fixing one thing. Result3 should calculate distinct.
- v-lili6-msftCommunity Support
hi, Anonymous
Use DISTINCTCOUNT in the formula
Result 3 = var _fromdate=CALCULATE(MIN(Sheet1[New Transaction Date]),ALLSELECTED(Sheet1)) var _enddate=CALCULATE(MAX(Sheet1[New Transaction Date]),ALLSELECTED(Sheet1)) return CALCULATE ( DISTINCTCOUNT( Sheet1[WalletID] ), FILTER ( Sheet1 , Sheet1[New Wallet Createddate] >= _fromdate && Sheet1[New Wallet Createddate] <= _enddate ) )Regards,
Lin