The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I need to filter my entire report to exclude customers who have a total of ZERO over their lifetime for a particular column. Given this data set:
CustID | ValA | ValB |
1234 | 0 | 50 |
1234 | 0 | 0 |
1234 | 0 | 150 |
4567 | 125 | 100 |
4567 | 125 | 200 |
I want to be able to EXCLUDE any customers whose Grand Total for ValA = 0. So in this example, Only customer 4567 would be on my report.
Not sure if I should put this in a calculated COLUMN that Sum's up ValA by customer resulting in this:
CustID | ValA | ValB | ValC |
1234 | 0 | 50 | 0 |
1234 | 0 | 0 | 0 |
1234 | 0 | 150 | 0 |
4567 | 125 | 100 | 250 |
4567 | 125 | 200 | 250 |
and then just filter out the zeros? How would I write the CalcColumn for ValC?
Or if there is a better way? Advice please.
Solved! Go to Solution.
@domtrump Try:
ValC Column =
VAR __Sum = SUMX(FILTER(ALL('Table'), [CustID] = EARLIER('Table'[CustID])),[ValA])
RETURN
__Sum
@domtrump Try:
ValC Column =
VAR __Sum = SUMX(FILTER(ALL('Table'), [CustID] = EARLIER('Table'[CustID])),[ValA])
RETURN
__Sum
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
28 | |
18 | |
13 | |
9 | |
5 |