Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |