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
gheecalipes25
Helper II
Helper II

how to get the count in a week format

Hi,

 

I column for Week Start date with the below dax formula:

WeekStartDate = 'ECM Data'[Date Created] - WEEKDAY('ECM Data'[Date Created], 2) + 1
 
but then we i get the total count of tickets, it is not getting the count per week. below is the result i am getting:
 
gheecalipes25_0-1666200910700.png

what are the additional measures/dax formulas needed for  me to get the total count per week.

 

Thanks.

 

 

 

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @gheecalipes25 ,

You can create a measure as below to get the count of tickets per week:

Count of tickets =
VAR _tab =
    SUMMARIZE (
        'ECM Data',
        'ECM Data'[WeekStartDate],
        "@count",
            CALCULATE (
                DISTINCTCOUNT ( 'ECM Data'[Ticket Number] ),
                FILTER (
                    'ECM Data',
                    'ECM Data'[WeekStartDate] = EARLIER ( 'ECM Data'[WeekStartDate] )
                )
            )
    )
RETURN
    SUMX ( _tab, [@count] )

yingyinr_0-1666232365225.png

Or you don't need to create any measure, just create a table visual with the field [WeekStartDate] and put the field [Ticket] with the aggregation function: Count(Distinct) just as below screenshot:

yingyinr_1-1666232458763.png

 

You can find all above information in the attachment.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
gheecalipes25
Helper II
Helper II

the formula worked. its good now. thank you

gheecalipes25
Helper II
Helper II

i am still getting the same result. i am not sure if the weekstartdate formula is the problem. Here's how icreated the weekstart date column:

 

WeekStartDate = 'ECM Data'[Date Created] - WEEKDAY('ECM Data'[Date Created], 2) + 1
 
v-yiruan-msft
Community Support
Community Support

Hi @gheecalipes25 ,

You can create a measure as below to get the count of tickets per week:

Count of tickets =
VAR _tab =
    SUMMARIZE (
        'ECM Data',
        'ECM Data'[WeekStartDate],
        "@count",
            CALCULATE (
                DISTINCTCOUNT ( 'ECM Data'[Ticket Number] ),
                FILTER (
                    'ECM Data',
                    'ECM Data'[WeekStartDate] = EARLIER ( 'ECM Data'[WeekStartDate] )
                )
            )
    )
RETURN
    SUMX ( _tab, [@count] )

yingyinr_0-1666232365225.png

Or you don't need to create any measure, just create a table visual with the field [WeekStartDate] and put the field [Ticket] with the aggregation function: Count(Distinct) just as below screenshot:

yingyinr_1-1666232458763.png

 

You can find all above information in the attachment.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.