Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all, im trying to create a measure that would count all rows where the column date is 1st day of next month however im getting an error when using the CALCULATE function.
"A function "CALCULATE" has been used in a true or false expression that is used as a table filter expression. This is not allowed."
Thank you in advance
Hi @georgec96
Thanks for reaching out to us.
I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.
If you need more help, please let me know.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @georgec96
please try
DK orders Left =
VAR NextMonth =
EOMONTH ( ebs_lcl_open_lines[order_due_date], 0 ) + 1
RETURN
CALCULATE (
COUNT ( ebs_lcl_open_orders[oracle_order_number] ),
ebs_lcl_open_orders[due_date] = NextMonth
)
@georgec96
Yes you can
DK orders Left =
VAR NextMonth =
EOMONTH ( MAX ( ebs_lcl_open_lines[order_due_date] ), 0 ) + 1
RETURN
CALCULATE (
COUNT ( ebs_lcl_open_orders[oracle_order_number] ),
ebs_lcl_open_orders[due_date] = NextMonth
)
Yes as there is no data for next month. You need to slice by or select date
column due_date containts the date 1st of july 2022 which is what I want to count.
I was hoping that the measure will return a count of all those rows where the due_date is 1st of july 2022
Ok then let's return nextmonth
DK orders Left =
VAR NextMonth =
EOMONTH ( MAX ( ebs_lcl_open_lines[order_due_date] ), 0 ) + 1
VAR Result =
CALCULATE (
COUNT ( ebs_lcl_open_orders[oracle_order_number] ),
ebs_lcl_open_orders[due_date] = NextMonth
)
RETURN
NextMonth
Hi @tamerj1 I have used the following formula
User | Count |
---|---|
25 | |
11 | |
8 | |
7 | |
6 |
User | Count |
---|---|
24 | |
13 | |
12 | |
10 | |
6 |