Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
- hi ,
I need count of my bidc column where "all units usa" measure is greater than 10.
I am not able to write measure inside a calculate function as filter.
=Calculate(count(dac),[all units usa]>10) ---this is showing error.. even i tried with variable still getting a error.
any help ?
Thanks
@nsatyabrat7
What is the error and how is the measure [all units usa] constructed?
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
hist units usa:=TRUNC(SUMX(product, product[historical_qty_usa])/[num distinct periods],2)
[all units usa] = CALCULATE([hist units usa],FILTER(all('date'[date_key]), 'date'[date_key]=max('date'[date_key])))
Now i want to create a measure like
[usa sku count] = calculate(count(product[sku]), [all units usa] >1)
error msg -
A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
hope i am able to clear you the requirement.
Hi @nsatyabrat7 ,
Share sample data if you can.
else try
[usa sku count] =
VAR _allunitsusa = [all units usa]
RETURN
COUNTX (
FILTER (
'Product',
_allunitsusa > 1
),
Product[Sku]
)
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @nsatyabrat7
You can't use a measure inside a boolean expression that is used as filter expression. There are certain rules related to this
Refer to this: https://docs.microsoft.com/en-us/dax/calculate-function-dax
Apart from this your measure [usa sku count] = calculate(count(product[sku]), [all units usa] >1) doesn't refer any column which needs to be filtered.
hi, i understand those rules about calculate function..but i am looking for a help or work around.
Hi @nsatyabrat7 can you share some sample data along with expected output and a clear description of the problem. Maybe then I can help you.
Thanks
Try something like:
Measure = COUNTX(FILTER('Table'[all units usa] > 10),[dac])
or
Measure = CALCULATE(COUNT('Table'[dac]),FILTER('Table'[all units usa] > 10))
If that does not help, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
no..its not working...
User | Count |
---|---|
21 | |
20 | |
14 | |
10 | |
8 |
User | Count |
---|---|
30 | |
28 | |
13 | |
12 | |
11 |