Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi
I am trying to make a calculate table with the conditions showing in the code. Problem is if i filter the table to FALSE() i get all of the possible reasons but i only want rows with the reason set in the code.
Where am i going wrong please?
test table v2 =
CALCULATETABLE('Activity',
OR(
'Activity'[Off The Job Hours Approved] = FALSE() && 'Activity'[Rejection Reason] = "Is English or Maths",
'Activity'[Off The Job Hours Approved] = TRUE() || 'Activity'[Off The Job Hours Approved] = BLANK())
)
Solved! Go to Solution.
Hi @SBR1D ,
Try the following code:
CALCULATETABLE(
'Activity OTJ',
'Activity OTJ'[Off The Job Hours Approved] = TRUE() || 'Activity OTJ'[Off the Job Hours Approved] == BLANK() ||
('Activity OTJ'[Off The Job Hours Approved] = FALSE() && 'Activity OTJ'[Rejection Reason] = "Is English or Maths")
)
The major change for your code is the parenthisis on the second part of the code where you use the and condition and the == blank() that forces the results to be exactly blank.
I have removed the filter part because the calculatetable syntax does the exact same thing in terms of the filter option in this case.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi
So i have played around with the dax code and doing the following works for if the Hours approved column is True/False where rejection reason is "Is English or Maths".
CALCULATETABLE ( 'Activity OTJ',
FILTER('Activity OTJ' ,
'Activity OTJ'[Off The Job Hours Approved] = TRUE() ||
'Activity OTJ'[Off The Job Hours Approved] = FALSE() && 'Activity OTJ'[Rejection Reason] = "Is English or Maths"))
Problem is if i add in a 3rd condition as shown below , approved hours to False no longer works and shows all reasons.
CALCULATETABLE ( 'Activity OTJ',
FILTER('Activity OTJ' ,
'Activity OTJ'[Off The Job Hours Approved] = TRUE() || 'Activity OTJ'[Off The Job Hours Approved] = BLANK() ||
'Activity OTJ'[Off The Job Hours Approved] = FALSE() && 'Activity OTJ'[Rejection Reason] = "Is English or Maths"))
Hi @SBR1D ,
Try the following code:
CALCULATETABLE(
'Activity OTJ',
'Activity OTJ'[Off The Job Hours Approved] = TRUE() || 'Activity OTJ'[Off the Job Hours Approved] == BLANK() ||
('Activity OTJ'[Off The Job Hours Approved] = FALSE() && 'Activity OTJ'[Rejection Reason] = "Is English or Maths")
)
The major change for your code is the parenthisis on the second part of the code where you use the and condition and the == blank() that forces the results to be exactly blank.
I have removed the filter part because the calculatetable syntax does the exact same thing in terms of the filter option in this case.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @SBR1D
Try the following code:
test table v2 =
CALCULATETABLE (
'Activity',
(
'Activity'[Off The Job Hours Approved] = FALSE ()
&& 'Activity'[Rejection Reason] = "Is English or Maths"
)
|| (
'Activity'[Off The Job Hours Approved] = TRUE ()
|| 'Activity'[Off The Job Hours Approved] = BLANK ()
)
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi
Thanks for the code but i tried it and it doesn't work. If i filter Hours Approved to False i still to see all Rejection reasons
When i filter the Hours Approved column to "False" i only see blanks in the cells but if i filter to "True" i can see the True values in the cells which is odd.
What is your expected outcome? Your boolean logic can be simplified.
CALCULATETABLE('Activity',
'Activity'[Off The Job Hours Approved] <> FALSE() || 'Activity'[Rejection Reason] = "Is English or Maths" )
hello , logic is as follows
if off the job hours approved is FALSE then filter the Rejection reason column to
"Is English or Maths"
and include the following - off the job hours approved = TRUE AND off the job hours approved = BLANK()
Hi @SBR1D ,
It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered? If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!
Hello, no i have had a solution yet. I posted on 12-24-2024 01:33 clarifying the issue.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |