Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

DAX Reorder

Hi,

 

sample.JPG                                                                          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 8
Anonymous
Not applicable

Hi,

 

Capture.JPG

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

@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.

 

 

Greg_Deckler
Super User
Super User

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


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler                                                                                                                                                                                           Capture.JPG

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.

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:

33.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto

Anonymous
Not applicable

HI @v-gizhi-msft                                                                                                                                                                                             

The Reordered outlets doesnt have to show the exact values as 100, 120, 160. it varies with the repeated occrence. could you please tell me why did you do - 20 in above dax 

                             

  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.

Hi,

 

I reviewed your logic and test as below:

pbix 

Hope this helps.

 

Best Regards,

Giotto

Anonymous
Not applicable

Hi @v-gizhi-msft ,

 

could you please review the logic agian. my logic is as given below.

i want to count the no of unique outlets repeating stores based on current week to previous week. i.e the current week no of unique outlets that are repeated from previous week.

 

Thanks

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.