Forum Discussion
powerbi_alvic
5 years agoFrequent Visitor
DAX Measure with Conditional Filters
Hello guys, I need help for this requirement. Number of tickets rejected that have been passed previously(create_time) by commercial queue. Is it possible to do it with a measure? ...
- 5 years ago
Hi,
This should work for you:
___CountPassedbyCommercialPrev = var _dateRejected = CALCULATE(MAX('Table'[create_time]),'Table'[state]="rejected") return COUNTROWS ( FILTER ( ALL ( 'Table' ), 'Table'[ticket_id] = SELECTEDVALUE ( 'Table'[ticket_id]) && 'Table'[queue] = "commercial" && 'Table'[create_time] <= _dateRejected ) ) ___CountPerTicket = SUMX(VALUES('Table'[ticket_id]),[___CountPassedbyCommercialPrev])Link to the file here.
In this video I explain how to approach and build such a measure. Hope its helpfull.
Kind regards,
Steve.
felipetrin
5 years agoRegular Visitor
Hi!
Try that:
Number of Tickets Rejected by Commercial =
CALCULATE(
COUNTROWS(Table),
Table[state] = "rejected",
Table[queue] = "commercial"
)
stevedep
5 years agoMemorable Member
Hi,
This should work for you:
___CountPassedbyCommercialPrev =
var _dateRejected = CALCULATE(MAX('Table'[create_time]),'Table'[state]="rejected")
return
COUNTROWS (
FILTER (
ALL ( 'Table' ),
'Table'[ticket_id] = SELECTEDVALUE ( 'Table'[ticket_id]) && 'Table'[queue] = "commercial" && 'Table'[create_time] <= _dateRejected )
)
___CountPerTicket =
SUMX(VALUES('Table'[ticket_id]),[___CountPassedbyCommercialPrev])
Link to the file here.
In this video I explain how to approach and build such a measure. Hope its helpfull.
Kind regards,
Steve.
- powerbi_alvic5 years agoFrequent Visitor
Great job, it is great !!!
Grateful for your help.
- stevedep5 years agoMemorable Member
powerbi_alvic , Welcome, hope you like the video? Thumbs up on the post(s) if you do 🙂