Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi people!
I'm new to Power BI and i'm having trouble to use the filter in the CALCULATE formula.
I have a table that contains these columns:
Client id A, Client id B and Total consumption.
Some times we charge our clients through the "Client id A" , other times through "Clients id B".
I created a conditional column that shows wich id we should charge called "Charged id", but i need to create a measure to aggregate this column by charged id.
I tried to use the CALCULATE formula, but i have thousands of Charged id numbers, so is basically impossible to create a different measure for each one. Is there a way to use the CALCULATE formula filter using each charged id?
If the answer is no, is there a formula that I can aggregate the sum of consumption by Charged id?
Thank you!
Solved! Go to Solution.
So far you should in a first place creat the following
Total Consumption =
SUM(table[agendas batch])
Then you go in the report view
somewhere on the right side you should find you created measure
Now you create a matrix visual. you put the measure in the "Value" area and the charge id into the "Rows" area
THen you shoul have a aggregated list of chaged ID with total consumption.
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
So far you should in a first place creat the following
Total Consumption =
SUM(table[agendas batch])
Then you go in the report view
somewhere on the right side you should find you created measure
Now you create a matrix visual. you put the measure in the "Value" area and the charge id into the "Rows" area
THen you shoul have a aggregated list of chaged ID with total consumption.
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
^Hi @luisfarantes ,
Can you maybe provide qn wasy sample of your data and an expected outcome, for example in a table or matrix?
Best regards
Michael
Hi , how u doing?
Sure, here is the table:
Where "nome participante" is the Client id A, and "nome detentor" is the Client id B. The column called "nome cobrado" is the Charged id, and the "agenda batch" is the total consumption.
I was able to create a calculated column with the following formula:
Total batch = CALCULATE(SUM('Agenda Batch - Out'[agendas batch]), FILTER('Agenda Batch - Out', 'Agenda Batch - Out'[Nome Cobrado] = EARLIER('Agenda Batch - Out'[Nome Cobrado])))
But I wasn't able to created it as a Measure, and in this case i need it as a Measure because later on i will apply another measure that is going to be de discount based on total consumption for each client.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |