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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

 


Follow on LinkedIn
@ 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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.