cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Looping in Dax for a particular week

Hi , I am trying to calculate the total no of the orders which are changed according to the DATE_CHANGED in each week.

 

Issue.JPG

As an example we have 13 total order numbers in one week.

the order number 463138 is repeated 4 times.So it should print 3 as the total count against this order number

Similarly for 463134 it should give 1 and so on

For order number 463137& 463135 the count should be 0 as it is not repeated here

 

So in this example it should print total count as 8 for this week

 

Please help me in solving this requirement.

1 REPLY 1
Highlighted
Super User I
Super User I

Hello @amkumar 

 

Based on your description, I have created it on a sample data:

Data.png

 

Following is the measure:

 

Count = 
VAR _Filter = 
    FILTER(
        'Table',
            'Table'[Date Changed] = "Sch Ship Date"
    )
VAR _Summary = 
    SUMMARIZE(
        _Filter,
            'Table'[Order Number],
            "Count",COUNT('Table'[Order Number])-1
            )
VAR _Total = SUMX(_Summary,[Count])
RETURN
_Total

 

Result:

 

Solution.png

 

Cheers!
Vivek

If it helps, please mark it as a solution. Kudos would be a cherry on the top 🙂
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)

Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors