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

Count of events in a week

Hi all, 

I am trying to come up with a measure to count how many events I have in each week of each year :

anabianco09_0-1695988401539.png

How can I use the CALCULATE or COUNT function?

 

Thanks in advance

1 ACCEPTED SOLUTION
cosm
Resolver II
Resolver II

Hi.

As mentioned - try to create a new measure 

Number of events = COUNTROWS()

, and add that measure to a table visual. Add the week number as well. 

 

Did that solve your problem?

View solution in original post

5 REPLIES 5
cosm
Resolver II
Resolver II

Hi.

As mentioned - try to create a new measure 

Number of events = COUNTROWS()

, and add that measure to a table visual. Add the week number as well. 

 

Did that solve your problem?

cosm
Resolver II
Resolver II

Hi.

Try adding your existing columns Year and Week of the Year.
Then create a measure:

Number of events = COUNTROWS()

 
See if that works for your specific problem.
If not, provide some information so it easier to the columns in your data model, and which you want to count.
Also, sample data with desired result can also be useful.


Kind regards

anabianco09
Helper II
Helper II

Hi @cosm, sorry I sent the wrong measure:

anabianco09_0-1695992762236.png

I do Have the week of YEAR and I want to count how many for each week number of each year... do you have a final measure for that?

cosm
Resolver II
Resolver II

Hi @anabianco09 

 

How do you want your final table to be displayed?

Assuming you want a table with the following columns

- Week number

- Number of events

 

One way to define a measure that counts the the number of rows is:

Number of events = COUNTROWS()

 

If you do not have either a date table or a column that holds information of week number -> you can create a calculated column that extracts Week Number from your column Cdate by:

Weeknumber = WEEKNUM(CDate)

 

The result looks like this (note - not your original data)

cosm_0-1695992468236.png

 

Hope this solves your problem.
If so, considering mark as solution so it is easier for other user to find the answer to similar questions.

Kind regards

Hi, I want a table exactly like this and I already have the weeknumber column. 

What would be the rest of the calculation for this: ? do I need to include any other parameter? Number of events = COUNTROWS()

 

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.