Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a report like under the screenshot, ID will have a different status,
Want to create a measure to count ID that not including a "Reject" status record,
The highlighted column is what I need, but from Dax, I don't know how to add conditions,
Thank you for your help.
Solved! Go to Solution.
maybe you can try this
approve count =
VAR _reject=countx(FILTER(all('Table'),'Table'[ID]=max('Table'[ID])&&'Table'[status]="reject"),'Table'[ID])
return if(ISBLANK(_reject),1)
pls see the attachment below
Proud to be a Super User!
Hi,
This measure works
Measure = COUNTROWS(FILTER(VALUES('Table'[ID]),CALCULATE(COUNTROWS('Table'),'Table'[status]="approve")>=1&&CALCULATE(COUNTROWS('Table'),'Table'[status]="reject")=0))
Hope this helps.
maybe you can try this
approve count =
VAR _reject=countx(FILTER(all('Table'),'Table'[ID]=max('Table'[ID])&&'Table'[status]="reject"),'Table'[ID])
return if(ISBLANK(_reject),1)
pls see the attachment below
Proud to be a Super User!
@ryan_mayu Hi Ryan, Thank you for your help. But I think I give a wrong example, make you misunderstand, I need count of "Approve" status without Reject ID, for example, I need under result, Do you have any idea? Thank you very much
pls try this
Measure = DISTINCTCOUNT('Table'[ID])-CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table','Table'[status]="reject"))
pls see the attachmetn below
Proud to be a Super User!
Thank you for your quick help, this measure does not work for my scenario, in real data sources, it also exists ID not Reject and also not Approve, for example my screenshot ID 6, I need create measure like under hightlight column, just count ID not exist Reject status and when it is apprve. @ryan_mayu
then what about this measure
Measure =CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table','Table'[status]="approve"))-CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER('Table','Table'[status]="reject"))
Proud to be a Super User!
Hi,
Share the download link of the PBI file.
Here is example file link, Thank you @Ashish_Mathur : https://www.dropbox.com/scl/fi/b75dq0ux1p8dwf8xv8kir/filterdatafromdax.pbix?dl=0&rlkey=i1jo0hm567u0g...
Hi,
This measure works
Measure = COUNTROWS(FILTER(VALUES('Table'[ID]),CALCULATE(COUNTROWS('Table'),'Table'[status]="approve")>=1&&CALCULATE(COUNTROWS('Table'),'Table'[status]="reject")=0))
Hope this helps.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
79 | |
58 | |
37 | |
35 |
User | Count |
---|---|
99 | |
56 | |
56 | |
46 | |
40 |