Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello,
Looking for a bit of help with a measure I can't seem to quite get right.
I have a table that has sales order lines. The Order # is repeated multiple times if there are different SKU's on the order. My first step is I wanted to sum the amount of units on each order, excluding certain types of units.
first measure:
Order Units =
CALCULATE(
DISTINCTCOUNT('Table 1'[Order]),
filter('Table 1',[Frames/Suns Sold] >=5 ))
I don't recieve any errors, but I do not get a count either, the column is blank.
I tried passing the Order Units calculation directly into the filter of the above measure as well with no dice.
End Result, I want to be able to see how many orders have 5 or more units (of a certain type) were placed over some period of time.
Thanks!
Solved! Go to Solution.
@Greg_Deckler Thanks Greg, I will be sure to include in the future. I actually found an answer:
Qualified Order Count =
Var units = Order Units
Return
Calculate(
DistinctCount('Table 1',
filter('Table 1', units >=5))
Passing the measure as a variable seems to do the trick, althought I am not 100% certain as to why.
Sample data would be tremendously helpful to replicate and test. 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
@Greg_Deckler Thanks Greg, I will be sure to include in the future. I actually found an answer:
Qualified Order Count =
Var units = Order Units
Return
Calculate(
DistinctCount('Table 1',
filter('Table 1', units >=5))
Passing the measure as a variable seems to do the trick, althought I am not 100% certain as to why.
By the way, you may help accept solution. Your contribution is highly appreciated.
https://www.sqlbi.com/?s=variable
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 77 | |
| 37 | |
| 31 | |
| 29 | |
| 26 |