Forum Discussion
DAX Reorder
Hi,
i have to write the measure for Reordered outlets i.e. for week 1 The Reorder outlets value is 0 as it has the fresh outlets. and for week 2 the Reorder outlets value is 100 i.e. The 140 outlets that has been repeated in the previous week outlets i.e. 120 and for week 3 the Re odrder outlets value is 120 i.e. The 180 outlets that has been repeated in the previous week outlets i.e. 140 and for week 4 Re order outlets the value is 160 i.e. the 205 outlets that has been repeated in the previous week outlets i.e. 180
Reordered rate is current week Reordered outelets / previous week no of unique outlets * 100
can anyone help in writing dax for Reordered outlets and Reordered rate
Thank you.
8 Replies
- Greg_DecklerCommunity Champion
I do not understand how you are getting your Reordered outlets numbers.
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- AnonymousNot applicable
Hi Greg_Deckler
Reordered outlets values which were mentioned above table are not exact values. it varies with repeated customer/outlets. week no 1 Reordered outlets is zero because those customers are fresh. there is no point of repeated customers. week no 2 Reordered outlets are 100 (as mentioned in table but this values can vary) i.e in week no 2 total unique no of outlets are are 140 and out of this 140 unique outles how many outlets has been repated from previous week 120 unique outlets.
week no 3 Reordered outlets are 120 (as mentioned in table but this values can vary) i.e in week no 3 total unique no of outlets are are 180 and out of this 180 unique outles how many outlets has been repated from previous week 140 unique outlets
week no 4 Reordered outlets are 160 (as mentioned in table but this values can vary) i.e in week no 4 total unique no of outlets are are 205and out of this 205 unique outles how many outlets has been repated from previous week 180 unique outlets.
Please let me know if you need to to know anything else to understand.
Thanks.
- v-gizhi-msftCommunity Support
Hi,
Please try these two measures:
Reordered outlets = IF ( MAX ( 'Table'[weekno] ) - 1 = 0, 0, CALCULATE ( MAX ( 'Table'[no of unique outlets] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[weekno] = MAX ( 'Table'[weekno] ) - 1 ) ) - 20 )Reorder rate = IF ( MAX ( 'Table'[weekno] ) - 1 = 0, 0, ( [Reordered outlets] - 20 ) / [Reordered outlets] )The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto
- AnonymousNot applicable
Hi,
Reordered outlets values which were mentioned above table are not exact values. it varies with repeated occrence of customer/outlets.
week no 1 Reordered outlets is zero because those customers are fresh. there is no point of repeated customers.
week no 2 Reordered outlets are 100 (as mentioned in table but this values can vary) i.e in week no 2 total unique no of outlets are are 140 and out of this 140 unique outles how many outlets has been repated from previous week 120 unique outlets.
week no 3 Reordered outlets are 120 (as mentioned in table but this values can vary) i.e in week no 3 total unique no of outlets are are 180 and out of this 180 unique outles how many outlets has been repated from previous week 140 unique outlets
week no 4 Reordered outlets are 160 (as mentioned in table but this values can vary) i.e in week no 4 total unique no of outlets are are 205 and out of this 205 unique outles how many outlets has been repated from previous week 180 unique outlets.
Reordered rate is (current week Reordered outelets / previous week no of unique outlets) * 100
can anyone help me in writing dax for Reordered outlets and Reordered rate.
Thanks
- amitchandakSuper User
Anonymous , this file can help you deal with last week using Rank. But for other calculations we need sample data
https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0
Can you share sample data.