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
Anonymous
Not applicable

PowerBI Equivalent of Countifs when referencing same-table cell

Hey there,

 

I'm trying to create a calculated column on a date table based on the values of another table. The secondary table has dates, along with a status "Open" or "Closed". I want to graph this to show a running count of how many are open/closed by day.

 

In Excel, I accomplish this by creating a table with dates on the left side, and an equation that checks to see if the left date is <= the date in the main data table and is the status open, if so, count it.

 

In PowerBI I've created my date table, and I've been researching for a few hours and have come across using the calculate formula to replicate countifs along with a measure, but I can't seem to find out how to get the calculated formula to reference the left date to check if the date in my secondary table is <= the left-most date.

 

Any ideas would be greatly appreciated. Thanks!

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
stretcharm
Memorable Member
Memorable Member

Take a look at this video from the @AlbertoFerrari of SQLBI whilst discussing optimisation of dax he shows an example of an Open Orders calculation which sounds similar to your problem.

 

The whole video is worth watching but the open orders bit starts around 49mins.

https://www.sqlbi.com/tv/dax-optimization-examples/

 

There are a number of posts on the forum about countif which you can do using CALCULATE count and filters.

Anonymous
Not applicable

Hey there,

 

I'm trying to create a calculated column on a date table based on the values of another table. The secondary table has dates, along with a status "Open" or "Closed". I want to graph this to show a running count of how many are open/closed by day.

 

In Excel, I accomplish this by creating a table with dates on the left side, and an equation that checks to see if the left date is <= the date in the main data table and is the status open, if so, count it.

 

In PowerBI I've created my date table, and I've been researching for a few hours and have come across using the calculate formula to replicate countifs along with a measure, but I can't seem to find out how to get the calculated formula to reference the left date to check if the date in my secondary table is <= the left-most date.

 

Any ideas would be greatly appreciated. Thanks!

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.