Forum Discussion
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
| Col1 | Col2 |
| Task1 | Publish |
| Task2 | Draft |
| Task3 | WIP |
| Task4 | Deleted |
| Task5 | Deleted |
| Task6 | Withdrwl |
| Task7 | Publish |
| Task8 | Publish |
| Task9 | Publish |
| Task10 | Draft |
| Task11 | New |
| Task12 | New |
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-sdhruvCommunity 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_pbiHelper 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)
Title Pdate Pstatus ReviewDt Titl1 5/28/2025 Published 7/23/2025 Titl2 5/28/2025 Published 4/23/2025 Titl3 5/28/2025 Published 7/23/2025 Titl4 5/28/2025 Published 7/23/2025 Titl5 5/28/2025 Draft 7/23/2025 Titl6 5/28/2025 Deleted 7/23/2025 Titl7 Draft 7/23/2025 Titl8 5/28/2025 Withdrawn 7/23/2025
- v-sdhruvCommunity 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!- manojk_pbiHelper V
v-sdhruv , thanks for the query. It works as expected.