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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
bdeleur
Helper III
Helper III

Help with a summary of date (count a day)

Hi, I have the following problem. I have a table that shows a value for each hour, each day, and each department. These values need to be summed up. I am able to create a matrix that shows the sum per day, per month. However, I would also like to count how often a value has occurred per month.

Below a short summary of the data. Of course it continues.

The categories are <5, 5><15, 15><25, >25

 

DatedepartmentCount
1-1-2024Afd A7
1-1-2024Afd B1
1-1-2024Afd C1
1-1-2024Afd D4
1-1-2024Afd E5
1-1-2024Afd F0
1-1-2024Afd G2
1-1-2024Afd H8
1-1-2024Afd I0
2-1-2024Afd A6
2-1-2024Afd B0
2-1-2024Afd C0
2-1-2024Afd D1
2-1-2024Afd E3
2-1-2024Afd F1
2-1-2024Afd G0
2-1-2024Afd H9
2-1-2024Afd I0
3-1-2024Afd A2
3-1-2024Afd B1
3-1-2024Afd C0
3-1-2024Afd D0
3-1-2024Afd E0
3-1-2024Afd F0
3-1-2024Afd G0
3-1-2024Afd H3
3-1-2024Afd I1

In excel i'm able to create the following matrix:

Rijlabelsjanuarifebruarimaartaprilmei

128720614
22032542
37324-47
41111191012
535161516
66-22012-1
712341210
811025315
96624427
1079221714
1107152419
129292510
133819112
1411110223
151714205
16299912
17115161127
18017111933
1911021932
20111151826
2173541615
22537111914
2301519-118
2482714718
25922131325
26823171728
271022182214
2881924145
290222792
303 20168
313 18 22

 

A month summary looks like this: it means 13 times less then 5, 16 times between 5 and 15, etc : 

 janfebmaraprmay
<5136265
5><15161291012
15><251816137
>2513417

 

I don't want the step with excel and want to do it in PowerBI directly but the last month summary is something I don't get fixed.

 

I hope somebody can help me

 

Gr

Bart

1 ACCEPTED SOLUTION

I count daily 'raw' DATA.

You count daily ’Total’ DATA.

mickey64_0-1720800262115.png

mickey64_1-1720801139073.png

Please make 2 measures and a Table below.

M_SUM Count = SUM(DATA[Count])

M_Category = IF([M_SUM Count]<5,"<5",IF([M_SUM Count]<15,"5><15",IF([M_SUM Count]<25,"15><25",">25")))

Table = SUMMARIZE('DATA',DATA[Date],"SUM Count",[M_SUM Count],"Category",'DATA'[M_Category])

mickey64_2-1720801305030.png

 

View solution in original post

12 REPLIES 12
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mickey64
Super User
Super User

Step 0: I use your data.

    Date: yyyy/mm/dd

mickey64_5-1720540164707.png

 

Step 1: I add a 'Category' column to the table, below.

    Category = IF([Count]<5,"<5",IF([Count]<15,"5><15",IF([Count]<25,"15><25",">25")))

mickey64_4-1720540128404.png

 

 

Step 3: I make 2 matrixs below.

mickey64_2-1720539812470.png

 

mickey64_3-1720539848509.png

 

Hi @mickey64 ,

 

Tnx for your answer. I followed your steps. De first matrix is no problem and validates with my excel. But when I created the second matrix something stranges happends. I get a totally different result:

bdeleur_0-1720687308977.png

Not al category's are present and the count doesn't fit the result I posted above. This is exactly the problem I encouterd.

 

 

 

The table we use for is a summary:

 

tabel = calculatetable(summarize(tabeloriginal, value, location, department, calender[date]), our = 6, filer for the departments))

 

Is that a problem?

In the second matrix, I use 'Count' of Category.

Do you use 'Sum' of Count?

 

mickey64_0-1720707418478.png

 

Count, but the strange thing is that not all categories are showed. 

Categories with no data are not displayed in the matrix, but is there any data that is not being displayed?

Yes I know. When I put the output in another database and use your calculated column it works perfectly. Ignore the sorting, but this is how the result must be.

bdeleur_0-1720793248242.png

So what makes it different when you use the output versus the original source. Do I need to make a new summary tabel? Will that fix the problem?

 

 

Does 'Totaal van Category' mean 'Count of Category'? 

mickey64_0-1720798095510.png

 

Hi, Yes Totaal is "aantal" so it means count. Not unique. Other choises are first and last.

I count daily 'raw' DATA.

You count daily ’Total’ DATA.

mickey64_0-1720800262115.png

mickey64_1-1720801139073.png

Please make 2 measures and a Table below.

M_SUM Count = SUM(DATA[Count])

M_Category = IF([M_SUM Count]<5,"<5",IF([M_SUM Count]<15,"5><15",IF([M_SUM Count]<25,"15><25",">25")))

Table = SUMMARIZE('DATA',DATA[Date],"SUM Count",[M_SUM Count],"Category",'DATA'[M_Category])

mickey64_2-1720801305030.png

 

Hi @mickey64 ,

 

YES this is it. Super. Now the count is perfect. You are wonderfull.

Thank you very much.

 

Greetings Bart

foodd
Super User
Super User

Please remember to adhere to the decorum of the Community Forum when asking a question.

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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