Forum Discussion
If less than statement
when i create a less than statment, why does power BI add records to table but the greater than statment works fine?
Because you have rows where the value of [Projection Accuracy 2] is blank and PowerBI sees blank as < .08 so it gives you a 0. You can change it to only return if [Projection Accuracy 2] is not blank.
Below Goal = VAR _ProjAcc = [Projection Accuracy 2] RETURN IF ( NOT ISBLANK ( _ProjAcc ), IF( _ProjAcc > .85, 1,0 ) )- Anonymous4 years ago
Hi mmowrey ,
You could use SUMX() function.
https://docs.microsoft.com/en-us/dax/sumx-function-dax
For example:
measure = sumx('table',[Below Goal])
Best Regards,
Jay
thanks so much .. this all worked.. one last question :).. when i take sum then divide by another number why would it come up as 0
Below Goal divided by Count of DriveID =DIVIDE([Below Goal Sum],COUNT(BloodDrive[DriveID]))- Anonymous4 years ago
mmowrey , 7 / 18 = 0.3888. If your measure [Below Goal divided by Count of DriveID] is formatted as Whole Number or to 0 decimal places, then it will display as zero.
7 Replies
- jdbuchanan71Super User
Because you have rows where the value of [Projection Accuracy 2] is blank and PowerBI sees blank as < .08 so it gives you a 0. You can change it to only return if [Projection Accuracy 2] is not blank.
Below Goal = VAR _ProjAcc = [Projection Accuracy 2] RETURN IF ( NOT ISBLANK ( _ProjAcc ), IF( _ProjAcc > .85, 1,0 ) )- mmowreyHelper I
thanks.. that worked.. how do i sum this formula to get a count?
- AnonymousNot applicable
Hi mmowrey ,
You could use SUMX() function.
https://docs.microsoft.com/en-us/dax/sumx-function-dax
For example:
measure = sumx('table',[Below Goal])
Best Regards,
Jay
- jdbuchanan71Super User
I'm going to need more information about the structure of your data to answer that question. Take a look at this post that outlines what we need to help answer your questions.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/td-p/1447523 - jdbuchanan71Super User
Is it because of rounding? 7/18 = 0.388889