Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a simple data set I need a mesure that counts(Distinct) by each Order ID , 1 if the sales is above the average and 0 if is below average.
Each order have many items, only I need the OrderID counts. The objective is to count how many orders are below or above the average sales in a single card or visual objetcts
Thanks for your help.
Marco
Solved! Go to Solution.
Please try this expression patter for a measure in a card visual
Orders Above Average =
VAR __avg =
CALCULATE ( AVERAGE ( Table[Sales] ), ALLSELECTED ( Table ) )
RETURN
COUNTROWS (
FILTER ( VALUES ( Table[OrderID] ), CALCULATE ( SUM ( Table[Sales] ) ) > __avg )
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this expression patter for a measure in a card visual
Orders Above Average =
VAR __avg =
CALCULATE ( AVERAGE ( Table[Sales] ), ALLSELECTED ( Table ) )
RETURN
COUNTROWS (
FILTER ( VALUES ( Table[OrderID] ), CALCULATE ( SUM ( Table[Sales] ) ) > __avg )
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |