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 August 31st. Request your voucher.
Hi,
I have a fact table that contains all of the columns: StmnUnits, TransDate and StmnDate. I want to sum StmnUnits if the TransDate is before or equal to the last date of the month that is being viewed (via Month & Year slicer) and the StmnDate is after the last day of the month that is being viewed ( Max(Dates[Date]) ). This is my measure formula:
Hi,
- is Dates[Date] connected to the Transactions table? If so, to which field?
- Don't do 2 filters, just combine them
FILTER(
Transactions,
Transactions[TransDate] <= MAX( Dates[Date] &&
Transactions[StmnDate] > MAX(Dates[Date])
)
Hi,
Thank you for your reply. There is an active relationship between Transactions[TransDate] and Dates[Date] and an inactive relationship between Transactions[StmnDate] and Dates[Date].
Ok, when you have this relation between TransDate and Date then you need to write:
VAR MaxSelectedDate = MAX(Dates[Date])
FILTER(
ALLSELECTED(Transactions),
Transactions[TransDate] <= MaxSelectedDate &&
Transactions[StmnDate] > MaxSelectedDate)
)
User | Count |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
7 |