We're giving away 30 tickets for FREE! Share your story, your vision, or your hustle and tell us why YOU deserve a ticket.
Apply nowWin a FREE 3 Day Ticket to FabCon Vienna. Apply now
Hi everybody. This might be a simple calculation, but I'm sort of new to Power BI and need help.
I have a table like this, with a batch, part, and batch size. A batch might have several parts, but the Batch Size is always the same.
I'm trying to sum the total Batch Size, but I want the sum to only sum distinct values of Batch, something like this:
How can I calculate a measure with this total in Power BI?
Thanks!
Solved! Go to Solution.
Hi @slofish
You can create several measures as follow:
Measure = RIGHT(MAX([Part]), 2)
rank = RANKX(ALLEXCEPT('Table', 'Table'[Batch]), [Measure], , DESC, Dense)
min = MINX(ALLEXCEPT('Table', 'Table'[Batch]), [rank])
sum = CALCULATE(SUM('Table'[Batch Size]), FILTER('Table',[rank] = [min]))
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @slofish
You can create several measures as follow:
Measure = RIGHT(MAX([Part]), 2)
rank = RANKX(ALLEXCEPT('Table', 'Table'[Batch]), [Measure], , DESC, Dense)
min = MINX(ALLEXCEPT('Table', 'Table'[Batch]), [rank])
sum = CALCULATE(SUM('Table'[Batch Size]), FILTER('Table',[rank] = [min]))
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
62 | |
59 | |
46 | |
35 | |
31 |
User | Count |
---|---|
85 | |
71 | |
57 | |
51 | |
46 |