Forum Discussion
Filter with 4 possible outcomes
- 6 years ago
Hi Anonymous ,
Please check:
1. Create Columns.
Paid? = IF ( fact_invoices[paid_at] <> BLANK (), "Already paid", "Not paid" )On time or late = IF ( fact_invoices[paid_at] <> BLANK () && fact_invoices[paid_at] <= fact_invoices[due_date], "Already paid & on time", IF ( fact_invoices[paid_at] <> BLANK () && fact_invoices[paid_at] > fact_invoices[due_date], "Already late & too late", IF ( TODAY () > fact_invoices[due_date], "Not yet paid & late", IF ( TODAY () < fact_invoices[due_date], "Not yet paid but customer has time" ) ) ) )2. Create a Paid Filter table.
Paid Filter = UNION ( VALUES ( fact_invoices[Paid?] ), VALUES ( fact_invoices[On time or late] ) )3. Create a Measure.
Filter Measure = SWITCH ( TRUE (), SELECTEDVALUE('Paid Filter'[Paid?])=BLANK(),1, SELECTEDVALUE ( 'Paid Filter'[Paid?] ) IN VALUES ( fact_invoices[Paid?] ), IF ( MAX ( fact_invoices[Paid?] ) = SELECTEDVALUE ( 'Paid Filter'[Paid?] ), 1 ), SELECTEDVALUE ( 'Paid Filter'[Paid?] ) IN VALUES ( fact_invoices[On time or late] ), IF ( MAX ( fact_invoices[On time or late] ) = SELECTEDVALUE ( 'Paid Filter'[Paid?] ), 1 ) )4. Put the measure above on the visuals you want to filter and set it =1.
5. Test.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Is this problem solved?
Best Regards,
Icey
- Anonymous6 years agoNot applicable
Icey yes sorry I haven't been able to test your suggestion yet. I will try it next week again when I get back to work. Sorry for the late/no reaction, I will let you know something next week, excuses!
- Anonymous6 years agoNot applicable
Icey first of all sorry for the late reaction. I was just trying your solution and I get an error with the measure. See image. Fact tables are renamed from "fact_invoices" to "fact-invoices"
Measure
Calculates columns:
table:
- Icey6 years ago
Community Support
Hi Anonymous ,
Please delete the extra half bracket in your Measure.
Best Regards,
Icey