cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Count if

Hi everyone

I have a table with my start and ending date, I'd like to make a count if in another table with month

So I have no problem to do that on Excel but on power Bi, it's impossible

First I have to make a relation between my two table but nothing has change I can't reach my goal

 

Any idea?

 

Untitled.png

 

Thanks in advnace

 

6 REPLIES 6
Highlighted
Super User IV
Super User IV

Re: Count if

A bit tough to decipher, but the equivalent in Power BI for COUNTIF is CALCULATE with a FILTER clause and you could use something like LOOKUPVALUE or SEARCH or RELATEDTABLE or RELATED or something along those lines. Can't really get a sense of you raw data. 


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Highlighted
Frequent Visitor

Re: Count if

Thank for your quick answer

So the idea is is to compare my month with end and start date

First Case: Sumif((StartDate < Month) AND end Date => Month +1))

And all my calculation are similar to this case

Highlighted
Super User IV
Super User IV

Re: Count if

But what does the data look like? I get there is a start date and an end date, but where is MONTH coming from? Is that current month or is that coming from another table??


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Highlighted
Frequent Visitor

Re: Count if

Month come from my table project with project name and ending date and start date

Highlighted
Frequent Visitor

Re: Count if

So this is what I'd like to do but automatically:

Mesure 2 = Calculate(count(TabJalons[Jalon]);(TabJalons[Starting Date]<DATE(2016;10;1));(TabJalons[Ending Date]>=date(2016;11;01)))

I'd like to get my Date(2016,10,1) et Date(2016,11,1) directly from a table

Highlighted
Microsoft
Microsoft

Re: Count if

Hi @domiowa,

You said "I'd like to get my Date(2016,10,1) et Date(2016,11,1) directly from a table" Let's assume the table name is Date, what the table look like? There is relationship between 'Date' and 'TabJalons', what's the relationship? Could you please share more details or .pbix file for further analysis?

Thanks,
Angelia

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors