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

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.

Reply
Anonymous
Not applicable

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
vivran22
Community Champion
Community Champion

Hello @Anonymous 

 

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.