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
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!:
The Definitive Guide to Power Query (M)

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
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.

Top Solution Authors