cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
srinival
Helper I
Helper I

Calculated Columns - Counif Functionality

Hi Team,

 

We have two tables like below

 

Problem

Problem Task

 

Problem has unique column Problem Id and Problem Task has PTASK ID as unique and we have feild Parent in PTASK ID which carries Problem ID.

 

Now I am looking to create a calculated column to list Number of Problem Tasks for a Problem ID.

Also From the Problem Task Table, there is a column named state which have multiple states like (Open / Assigned / Work In Progress / Pending / Closed)

 

I would like to could for the Problem ID how many Tasks are Closed.

 

 

 

For Eg: 

 

IF the Problem ID : PID1000 has 7 Tasks as below

 

Problem Task Table:

 

PTASK ID        State                                Parent

PTASK1001     Work in Progress              PID1000

PTASK1002     Assigned                           PID1000

PTASK1003     Closed                              PID1000

PTASK1004     Closed                             PID1000

.

.

PTASK1007   Closed                              PID1000

 

 

In Problem Table I want to count the number of PTASKS for a Problem and also the PTASKS Closed out of them,

 

 

To Count the PTASKS I have used the DAX as below in Problem Table

 

Problem Table on Calculated Column as below

Tot PTASKs = COUNTROWS(RELATEDTABLE(PTASK))

 

 

Another Column as 

Closed PTASKS = COUNTROWS(
FILTER
(
RELATEDTABLE(PTASK),
PTASK[State]="Closed"
))

 

But now i am not able see only blank information, 

 

I have created a One to Many Relation between Problem and Problem Task Table between Problem ID and Parent Field in PTASK Table.

 

Please advise how we can get the closed PTASKS Information

 

Appreciate your help.

 

Regards

Srini

2 REPLIES 2
Greg_Deckler
Super User
Super User

@srinival - See if this helps: 

https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

I was not clear, can you give me an idea how we can get the details in my problem.

 

Regards

Srini

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors