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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RTW93
Frequent Visitor

Count per day

Hey guys,

 

i try to solve my problem since 2 days...

I have a table "login" with 2 Colums:

[id] and [date]

I Created a Extra Table "calendar" with all dates from the 01.01.2017 to the 30.07.2017.

Now i tryed to get a new colum in "calendar" [ID count]. This Colum should show me how many id's from "login" logged in per day.

 

can someone help me?

 

Thank you

RTW-93

1 ACCEPTED SOLUTION

Hi @RTW93,

 

as a best practice you should use a measure and then apply it based on context because columns only add to your model, and if one expression can change into a measure do it instead of a column, but the syntax for the new colum in calendar table sould be one of this two:

 

Count per day = CALCULATE(COUNT(Login[ID]), RELATEDTABLE(Login))
Count per day = COUNTROWS(RELATEDTABLE(Login))

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

7 REPLIES 7
MFelix
Super User
Super User

Hi @RTW93,

 

You don't need to create a new column if you add the date column (from calendar table) and the ID and select summarize count it will give you the expected result be aware that you need to have both tables related.

 

sss.png

 

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



RTW93
Frequent Visitor

Hey MFelix,

 

thanks for your answer,  but i need the Colum saved in the table (using table/new Colum). Based on it i need to calculate some other things...

Hi @RTW93,

 

as a best practice you should use a measure and then apply it based on context because columns only add to your model, and if one expression can change into a measure do it instead of a column, but the syntax for the new colum in calendar table sould be one of this two:

 

Count per day = CALCULATE(COUNT(Login[ID]), RELATEDTABLE(Login))
Count per day = COUNTROWS(RELATEDTABLE(Login))

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix, I have bit similar problem but in my case I have one more column of True/False and I want to take only true rows..How could I do this. Could you please address.

Hi @anandsonar1 ,

 

Can you please share a sample data and expected result.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



RTW93
Frequent Visitor

Thanks again,

if i use your Solutions i get on every day 3603 (the count of all rows).

You need to relate both tables to use this formulas.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.