Forum Discussion
Analitika
Post Prodigy
3 years agoSum values in column by condition in Power Bi
Hi, I have columns in table, quantity and date. I need to calculate sum values based on last date of that object. For example: First column quantity, second - date Based on t...
Mikelytics
Resident Rockstar
3 years agoHi Analitika
Can you please try:
kiekis_test1 =
var __LastDate = LASTDATE(op_detales[Dokumento data])
RETURN
CALCULATE(
sum(op_detales[qty_in]),
FILTER(op_detales,op_detales[Dokumento data]=__LastDate && op_detales[modul]="Pirkimai")
)
Can you please show the results in a visual if it does not work? By that I can better see how you use the measure.
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.
- Analitika3 years ago
Post Prodigy
Now I am getting null result like this:
- Mikelytics3 years ago
Resident Rockstar
Are there any filters applied to the visual? Can you maybe provide sample data?
- Analitika3 years ago
Post Prodigy
Nope, I don't see filters