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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
romovaro
Responsive Resident
Responsive Resident

Custom Dax Calculating columns

 

 I need to create the following custom measures but i am having issues with the formula:
 
Below the table with the columns I need.
Task column has a lot of different and I only need to count the ones "Pre Engagement Process" and "IPM HandOff".
 
CLIENT_NAMECIDTASKTASK_STATUSSCHEDULED
Customer A380206Pre Engagement ProcessClosed18-AUG-21  
Customer A380206IPM HandOffClosed 
Customer B380208Pre Engagement ProcessClosed07-jul-21
Customer B380208IPM HandOffClosed20-jul-21
Customer C380209Pre Engagement ProcessReceived 
Customer D380210IPM HandOffClosed10-AUG-21  
Customer D380210Pre Engagement ProcessClosed31-jul-21

 

Total Tasks Pre engagement Team. (Formula that calculates all the task with task: "Pre Engagement Process" and Task_Status "Closed & Received" and all the task : "IPM HandOff" with Task_status "Received")

 

Total Tasks Pre-Engagement Team = CALCULATE(COUNTROWS(CELERGO_12062021V1),Filter(CELERGO_12062021V1,CELERGO_12062021V1[TASK_STATUS] ="Received" && CELERGO_12062021V1[TASK] IN { "Pre Engagement Process", "IPM HandOff" }))   
(I just need to add in the formula that I also want "Pre Engagement Process = Closed). Tried different options but...

 

 Total Tasks Pre engagement Team Closed. (Formula that calculates all the task with task: "IPM HandOff" and Task_Status "Closed" and have a Scheduled Date

 

Total Tasks Pre-Engagement Team Closed = CALCULATE(COUNTROWS(CELERGO_12062021V1),Filter(CELERGO_12062021V1,CELERGO_12062021V1[TASK] ="IPM HandOff" && CELERGO_12062021V1[TASK_STATUS]="Closed"))
(I just need to add in the formula that I want to add the count  with a date in the Schedule column)
 
 
Thanks
3 ACCEPTED SOLUTIONS
v-jingzhang
Community Support
Community Support

Hi @romovaro 

 

You can use || (OR) in the measure. 

Total Tasks Pre-Engagement Team = 
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        ( CELERGO_12062021V1[TASK_STATUS] IN { "Received", "Closed" } && CELERGO_12062021V1[TASK] = "Pre Engagement Process" )
            || ( CELERGO_12062021V1[TASK_STATUS] = "Received" && CELERGO_12062021V1[TASK] = "IPM HandOff" )
    )
)

21122003.jpg

 

And use NOT(ISBLANK()) to determine whether a row in the column has a value. 

Total Tasks Pre-Engagement Team Closed = 
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        CELERGO_12062021V1[TASK] = "IPM HandOff"
            && CELERGO_12062021V1[TASK_STATUS] = "Closed"
            && NOT ( ISBLANK ( CELERGO_12062021V1[SCHEDULED] ) )
    )
)

21122004.jpg

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

Hi @romovaro 

 

You can tweak the current measures. 

Total Tasks Pre-Engagement Team =
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        ( CELERGO_12062021V1[TASK_STATUS] IN { "Received", "Closed" }
            && CELERGO_12062021V1[TASK] = "Pre Engagement Process" )
    )
)
Total Tasks Pre-Engagement Team Closed =
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        CELERGO_12062021V1[TASK] = "IPM HandOff"
            && CELERGO_12062021V1[TASK_STATUS] = "Closed"
    )
)

Then create a third measure

Current Workload = [Total Tasks Pre-Engagement Team] - [Total Tasks Pre-Engagement Team Closed]

 

Best regards,

Jing

View solution in original post

Hi @romovaro 

 

You can use this measure as a filter field in the table visual.

Flag =
VAR __clientsPEP =
    SELECTCOLUMNS (
        FILTER (
            ALL ( CELERGO_12062021V1 ),
            ( CELERGO_12062021V1[TASK_STATUS]
                IN { "Received", "Closed" }
                && CELERGO_12062021V1[TASK] = "Pre Engagement Process" )
        ),
        "Client", CELERGO_12062021V1[CLIENT_NAME]
    )
VAR __clientIH =
    SELECTCOLUMNS (
        FILTER (
            ALL ( CELERGO_12062021V1 ),
            CELERGO_12062021V1[TASK] = "IPM HandOff"
                && CELERGO_12062021V1[TASK_STATUS] = "Closed"
        ),
        "Client", CELERGO_12062021V1[CLIENT_NAME]
    )
VAR __current = EXCEPT ( __clientsPEP, __clientIH )
RETURN
    IF ( SELECTEDVALUE ( CELERGO_12062021V1[CLIENT_NAME] ) IN __current, 1 )

21122904.jpg

 

Best Regards,

Jing

View solution in original post

10 REPLIES 10
v-jingzhang
Community Support
Community Support

Hi @romovaro 

 

You can use || (OR) in the measure. 

Total Tasks Pre-Engagement Team = 
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        ( CELERGO_12062021V1[TASK_STATUS] IN { "Received", "Closed" } && CELERGO_12062021V1[TASK] = "Pre Engagement Process" )
            || ( CELERGO_12062021V1[TASK_STATUS] = "Received" && CELERGO_12062021V1[TASK] = "IPM HandOff" )
    )
)

21122003.jpg

 

And use NOT(ISBLANK()) to determine whether a row in the column has a value. 

Total Tasks Pre-Engagement Team Closed = 
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        CELERGO_12062021V1[TASK] = "IPM HandOff"
            && CELERGO_12062021V1[TASK_STATUS] = "Closed"
            && NOT ( ISBLANK ( CELERGO_12062021V1[SCHEDULED] ) )
    )
)

21122004.jpg

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

 

it seems I would need the same formula but instead of using the "OR"..I need Minus IPM handOff Closed

 

I need to provide the total of "Pre Engagement Process - Closed and recevied) like your formula does...

 

MINUS

 

the IPM HandOff Tasks with status closed. (instead of Received)

 

How could I add the minus in the formula? Thanks

Hi @romovaro 

 

You can tweak the current measures. 

Total Tasks Pre-Engagement Team =
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        ( CELERGO_12062021V1[TASK_STATUS] IN { "Received", "Closed" }
            && CELERGO_12062021V1[TASK] = "Pre Engagement Process" )
    )
)
Total Tasks Pre-Engagement Team Closed =
CALCULATE (
    COUNTROWS ( CELERGO_12062021V1 ),
    FILTER (
        CELERGO_12062021V1,
        CELERGO_12062021V1[TASK] = "IPM HandOff"
            && CELERGO_12062021V1[TASK_STATUS] = "Closed"
    )
)

Then create a third measure

Current Workload = [Total Tasks Pre-Engagement Team] - [Total Tasks Pre-Engagement Team Closed]

 

Best regards,

Jing

Thank you Jing.

And if I want to show the 27 current worload projects in a table? Tried different ways but i always get more than 27 (in this case)

 

romovaro_0-1640073158622.png

 

Hi @romovaro 

 

Sorry for the late reply. The requirement is not clear. Based on the current sample data, the red 4 lines compose the first measure and the green 3 lines compose the second measure. Their difference is 1. But if you want to show the current one workload, it's not clear which one should be it?

21122403.jpg

 

Regards,

Jing

Hi Jin

 

The pre engagement team starts working when Pre Engagement is "received"...when they have finished with the customer they change status to "closed"....but they are still in charge (current workload"...until IPM handOff is closed.

 

In the table (according to the example) the only 1 is= Customer C

Hi @romovaro 

 

You can use this measure as a filter field in the table visual.

Flag =
VAR __clientsPEP =
    SELECTCOLUMNS (
        FILTER (
            ALL ( CELERGO_12062021V1 ),
            ( CELERGO_12062021V1[TASK_STATUS]
                IN { "Received", "Closed" }
                && CELERGO_12062021V1[TASK] = "Pre Engagement Process" )
        ),
        "Client", CELERGO_12062021V1[CLIENT_NAME]
    )
VAR __clientIH =
    SELECTCOLUMNS (
        FILTER (
            ALL ( CELERGO_12062021V1 ),
            CELERGO_12062021V1[TASK] = "IPM HandOff"
                && CELERGO_12062021V1[TASK_STATUS] = "Closed"
        ),
        "Client", CELERGO_12062021V1[CLIENT_NAME]
    )
VAR __current = EXCEPT ( __clientsPEP, __clientIH )
RETURN
    IF ( SELECTEDVALUE ( CELERGO_12062021V1[CLIENT_NAME] ) IN __current, 1 )

21122904.jpg

 

Best Regards,

Jing

Your formula already does that.  If you filter by a particular value A then you don't need to include another condition to exclude value B - that is already implicit.

 

AND  = all conditions apply

OR = any one condition is sufficient

 

By the way your "minus"  would translate to AND NOT  (if it were needed)

 

 

romovaro
Responsive Resident
Responsive Resident

Hi Ibendin...

 

THe "pre engagement team" has decided that the best value to show their performance is to calculate:

 

equirement 1 = Pre Engagement Process - Closed and recevied minus the IPM HandOFF already closed

 

I guess that using "AND NOT" is not going ot help. I need this calculation to reduce from the total (requirement 1). I need to count them in order to get "my 27" table below

 

romovaro_0-1640015557024.png

 

lbendlin
Super User
Super User

Not exactly clear what your boolean statement would look like but your can use "IN"  as stand-in for "OR"

 

CALCULATE(COUNTROWS(CELERGO_12062021V1),CELERGO_12062021V1[TASK_STATUS] IN {"Received","Closed"},  CELERGO_12062021V1[TASK] IN { "Pre Engagement Process", "IPM HandOff" })   

, as you already did for part of it. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors