Forum Discussion
Anonymous
10 years agoNot applicable
DistinctCount IF?
Hi All, I'm new to Power BI (and DAX) coming from Tableau. I've got a question regarding the DiscountCount function. I need to calculate a percentage of orders that include a certain item...
- 10 years ago
CALCULATE( DISTINCTCOUNT( FactOrder[OrderNumber] ) ,FactOrder[Line Item] = <certein item number> )
greggyb
Resident Rockstar
10 years agoCALCULATE(
DISTINCTCOUNT( FactOrder[OrderNumber] )
,FactOrder[Line Item] = <certein item number>
)Anonymous
10 years agoNot applicable
Worked perfectly! Thank you so much!
- Anonymous10 years agoNot applicable
If you want to understand the reason behind that answer, check this out: http://www.powerpivotpro.com/2009/12/powerpivot-dax-calculate-is-a-supercharged-sumif/
Actually the title of that blog post is slightly misleading; CALCULATE is a supercharged WHATEVERIF. COUNTIF, SUMIF, DIVIDEIF, etc. depending on what kind of expression you feed into it. That whole blog is a fantastic resource for learning DAX, and they've got a great book as well.
- Anonymous10 years agoNot applicable
Thank for the resource, I really appreciate it!