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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

To have Countifs in PowerBI

Hi, I am trying to create a table as in sheet2 as below - 

Dump Date12/17/2021  
    
Status15-Dec16-Dec17-Dec
Tickets Opened per day210

with the data coming from base sheet1 as 

Dump DateCreatedCtype
15-Dec15-Dec-21C1
17-Dec16-Dec-21C2
16-Dec14-Dec-21 
17-Dec15-Dec-21C2
17-Dec15-Dec-21C1

 

If you seee sheet2 the formula being used is like - =COUNTIFS(Sheet1!$A:$A,$D$10,Sheet1!$C:$C,"*",Sheet1!$B:$B,Sheet2!D$12)

 

Sheet2.png

 

I am trying to create the table as in sheet2. please help. thanks,Chandra

1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

You can try the following methods.

Table1:

vzhangti_0-1640066212824.png

Table2:

Dump date = TODAY()
Tickets Opened per day = 
CALCULATE (
    COUNT ( Table1[Ctype] ),
    FILTER (
        Table1,
        [Ctype] <> BLANK ()
            && [Dump date] = EARLIER ( Table2[Dump date] )
            && [Created] = EARLIER ( Table2[Status] )
    )
)

vzhangti_2-1640066392857.png

vzhangti_3-1640066449926.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
VahidDM
Super User
Super User

Hi @Anonymous 

 

Can you post sample data as text and expected output?
Not enough information to go on;

please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

Anonymous
Not applicable

Hi Vahid,

Sample data table is as below -

Dump DateCreatedCtype
15-Dec15-Dec-21C1
17-Dec16-Dec-21C2
16-Dec14-Dec-21 
17-Dec15-Dec-21C2
17-Dec15-Dec-21C1

Expected output -

Dump Date12/17/2021  
Status15-Dec16-Dec17-Dec
Tickets Opened per day210

I have the above table in excel and usign formulae - Dumpdate = today() and for Tickets opened if I click on the row in excel I have formula like =COUNTIFS(Sheet1!$A:$A,$D$10,Sheet1!$C:$C,"*",Sheet1!$B:$B,Sheet2!D$12) ffor getting B4 which is 2 and =COUNTIFS(Sheet1!$A:$A,$B$1,Sheet1!$C:$C,"*",Sheet1!$B:$B,Sheet2!C$3) for getting B5 which  is 1 and =COUNTIFS(Sheet1!$A:$A,$B$1,Sheet1!$C:$C,"*",Sheet1!$B:$B,Sheet2!D$3) for B6 whic is 0

chandra_pb_0-1639741547222.png

 

The sheets are related by the formula that I use. Hope this helps, Chandra.

Hi, @Anonymous 

 

You can try the following methods.

Table1:

vzhangti_0-1640066212824.png

Table2:

Dump date = TODAY()
Tickets Opened per day = 
CALCULATE (
    COUNT ( Table1[Ctype] ),
    FILTER (
        Table1,
        [Ctype] <> BLANK ()
            && [Dump date] = EARLIER ( Table2[Dump date] )
            && [Created] = EARLIER ( Table2[Status] )
    )
)

vzhangti_2-1640066392857.png

vzhangti_3-1640066449926.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi,

I got confused on how the table 2 can even be created? Because I just have the table 1 in my mail as input and the desired output is actually table2. If I create the table 2 or the desired outcome then what are we calculating? Can you please explain? Best Regards, Chandra.

Hi, @Anonymous 

 

Table 2 can be obtained from Table 1 by using the table manipulation function.

vzhangti_2-1640223702344.png

Table 2 = DISTINCT('Table 1'[Dump Date])

Rename the first column to Status again.

vzhangti_3-1640223841943.png

Please refer to the attachment if this is the output you are expecting.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.