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 created a measure (Delivery Hours Difference) by subtracting the values of two columns:
Now I need to get a card with a 'rate' value that is: The amount of positive rows in Delivery Hours Difference divided by the total amount of rows. How can I achieve this?
Solved! Go to Solution.
Hi @tuliosouzaa , You can try below DAX
I have used total row counts both positive and negative
Rate = DIVIDE( CALCULATE( COUNTROWS('YourTableName'), 'YourTableName'[Delivery Hours Difference] > 0 ), COUNTROWS('YourTableName') )
Please accept as solution and give kudos if it helps
Proud to be a Super User! |
|
Hi @tuliosouzaa , You can try below DAX
I have used total row counts both positive and negative
Rate = DIVIDE( CALCULATE( COUNTROWS('YourTableName'), 'YourTableName'[Delivery Hours Difference] > 0 ), COUNTROWS('YourTableName') )
Please accept as solution and give kudos if it helps
Proud to be a Super User! |
|
I see that makes sense and I understand the logic, but I get a ' function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.' error.
I fixed it editing the filter:
DIVIDE( CALCULATE( COUNTROWS('TableName'), FILTER(VALUES('TableName'), [Delivery Hours Difference] >0)),COUNTROWS('TableName') )
Thanks for the help!
What do you mean by the total count of the columns?
you mean total occurrance of the positive values?
I did not express myself correctly. Tha would be the total amount of rows. I edited the original question.
Hi @tuliosouzaa
As per the screenshot, this is the required result, right?
Diff/(total rows where diff is >0)
The result I need it the count of positive rows divided by the count of all rows. In your example that would be 0.33, being 5 positive diff rows divided by 15 total rows.
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 |
---|---|
73 | |
71 | |
55 | |
37 | |
32 |
User | Count |
---|---|
71 | |
65 | |
60 | |
50 | |
45 |