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
Aquatophana
New Member

Counting the number of occurence in a filtered table

Hello !

I am pretty new to powerbi, so forgive me for not using the proper expressions (apologies too for my English, I am not a native English speaker)

 

I am having headache trying to solve an issue.

I want to count the number of time a given person (column [Name]) answered to a question  (column [Date.answers]) after a certain date.

So i tried to do the following :

 

1 - First i created a new filtered table which is only showing up the last answers given by each person

 

Last answers = SUMMARIZE(FILTER(CROSSJOIN(Query1;'Lastestanswers'); Query1[Name]='Lastestanswers'[Column 2] && Query1[Date.answers]='Latestanswers'[Date.answers]); Query1[Name]; Query1[Date.answers])

 

2 - Then, i wanted to count the number of occurences the name of each person appears and at the same time only count the answers given after a certain date. I can already get this number when I want to vizualise those data using filtering and suche, but i want to have it as a measure so i can cross that data.

 

Number of time each name appeared (so preventing the name of those who did not answer to be counted) = COUNTX(FILTER('Last answers';('Last answers'[Date.answers]>DATE(XXXX;XX;XX)))

 

The first expression gives me the result i want, the second otherwise shows that there is a problem. I tried to add a countrows but it didn't work.

 

Thanks in advance

1 ACCEPTED SOLUTION

Hi @v-yulgu-msft, thanks for replying.

 

I have found a solution using the Group By function which is working fine for my needs. I could not provide any sample data as the one I am using are confidential, but I will make sure in the future to give more information regarding my needs.

 

Thanks again

View solution in original post

4 REPLIES 4
v-yulgu-msft
Employee
Employee

Hi @Aquatophana,

 

To help me better understand the meaning of above formulas, please provide sample data of all necessary tables. Also, please illustrate your desired output with examples, it would be better you can post an image.

 

Regards,
Yuliana Gu

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

Hi @v-yulgu-msft, thanks for replying.

 

I have found a solution using the Group By function which is working fine for my needs. I could not provide any sample data as the one I am using are confidential, but I will make sure in the future to give more information regarding my needs.

 

Thanks again

Hi @Aquatophana,

 

Glad to hear that you have found a valid solution. Would you please kindly mark your sharing solution as an answer so that others having similar requirement can find the solution more easily?

 

Regards,
Yuliana Gu

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

Hello !

I am pretty new to powerbi, so forgive me for not using the proper expressions (apologies too for my English, I am not a native English speaker)

 

I am having headache trying to solve an issue.

I want to count the number of time a given person (column [Name]) answered to a question (column [Questions]) after a certain date.

So i tried to do the following

 

First i created a new filtered table which is only showing up the last answers given by each person

Last answers = SUMMARIZE(FILTER(CROSSJOIN(Query1;'Lastestanswers'); Query1[Name]='Lastestanswers'[Column 2] && Query1[Date.answers]='Latestanswers'[Date.answers]); Query1[Name]; Query1[Date.answers])

 

Then, i wanted to have a measure of this number and at the same time only count the answers given after a certain date. I can already get this number when I want to vizualise those data using filtering and suche, but i want to have it as a measure so i can cross that data.

 

Number of time each name appeared (so preventing the name of those who did not answer to be counted) = COUNTX(FILTER('Last answers';('Last answers'[Date.answers]>DATE(XXXX;XX;XX)))

 

The first expression gives me the result i want, the second otherwise shows that there is a problem. I tried to add a countrows but it didn't work.

 

Thanks in advance

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.