Forum Discussion

manojk_pbi's avatar
manojk_pbi
Helper V
1 year ago
Solved

Need help in writing DAX Measure

Hi Friends,

 

I have below data, using it i need to show what's the percentage of published task out of total tasks. Pls advice how can we do this both in KPI chart and in table.

% of Published Tasks = Tasks with publish status / all tasks excluding Delete & withdrwl

 

Col1Col2
Task1Publish
Task2Draft
Task3WIP
Task4Deleted
Task5Deleted
Task6Withdrwl
Task7Publish
Task8Publish
Task9Publish
Task10Draft
Task11New
Task12New
  • Hi manojk_pbi ,
    You can try this measure:

    % Published Tasks =
    DIVIDE(
    CALCULATE(COUNTROWS(Data), Data[Col2] = "Publish"),
    CALCULATE(COUNTROWS(Data), NOT(Data[Col2] IN {"Deleted", "Withdrwl"}))
    )
    Hope this helps!
    If the response has addressed your query, please accept it as a solution  so other members can easily find it.
    Thank you.

  • Hi manojk_pbi ,

    You can try this-
    ValidPg% =
    DIVIDE(
    CALCULATE(
    COUNTROWS(Data),
    NOT(ISBLANK(Data[Pdate])),
    Data[ReviewDt] <= TODAY()
    ),
    CALCULATE(
    COUNTROWS(Data),
    NOT(ISBLANK(Data[Pdate])),
    NOT(Data[Pstatus] IN {"Deleted", "Withdrawn"})
    )
    )
    Hope this helps!

4 Replies

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi manojk_pbi ,
    You can try this measure:

    % Published Tasks =
    DIVIDE(
    CALCULATE(COUNTROWS(Data), Data[Col2] = "Publish"),
    CALCULATE(COUNTROWS(Data), NOT(Data[Col2] IN {"Deleted", "Withdrwl"}))
    )
    Hope this helps!
    If the response has addressed your query, please accept it as a solution  so other members can easily find it.
    Thank you.

    • manojk_pbi's avatar
      manojk_pbi
      Helper V

      Hi v-sdhruv ,

       

      thanks for the measure it worked. 

      Request you to guide me on this extended requirement on similar data.  

      Need to calculate % of valid page here. 

       

      ValidPg% = No Titles where Pdate not "" or null and ReviewDt less than or equal to Todays dt /

      all titles where Pdate not "" or null and state not in (Deleted, withdrawn)

       

      TitlePdatePstatusReviewDt
      Titl15/28/2025Published7/23/2025
      Titl25/28/2025Published4/23/2025
      Titl35/28/2025Published7/23/2025
      Titl45/28/2025Published7/23/2025
      Titl55/28/2025Draft7/23/2025
      Titl65/28/2025Deleted7/23/2025
      Titl7 Draft7/23/2025
      Titl85/28/2025Withdrawn7/23/2025
  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi manojk_pbi ,

    You can try this-
    ValidPg% =
    DIVIDE(
    CALCULATE(
    COUNTROWS(Data),
    NOT(ISBLANK(Data[Pdate])),
    Data[ReviewDt] <= TODAY()
    ),
    CALCULATE(
    COUNTROWS(Data),
    NOT(ISBLANK(Data[Pdate])),
    NOT(Data[Pstatus] IN {"Deleted", "Withdrawn"})
    )
    )
    Hope this helps!