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 ,
What's the meaning? 🤔
Best Regards,
Icey
Aah I some of my text got deleted. I wanted to say that the filter is working but that it has different outputs than what I expected. I compared my results to yours and they were a bit different. That is what I wanted to show you in the pictures but it didn't came out as planned. I see only your pictures came through so I'll add mine in this post, hope that works.
Well the general meaning is to track customer payment time and have it in a user-friendly way whitout having too much filters on the top if that mat concern you as well. But I think we might stick to having 3 different filters tho, makes the rest a bit simpler...
already paid
already paid & late
Not paid:
Not paid & will be late
Not paid & still time
- Icey6 years ago
Community Support
Hi Anonymous ,
Well, you can choose to use any method that you think is simpler.😉
And what's the axis of the stacked bar charts?
Best Regards,
Icey
- Anonymous6 years agoNot applicable
Well pure for the user having one filter is easier. But once I leave this project I also mist be able to explain what I have build and how they can change this later if needed. So maintenance wise the 3 filter approach would be simpler. which one to use is something I must yet decide, if I can figure out how ur measure works I moght use that one tho!
For your question:
Axis = Company name
Legend= +5 days late or -5days late
Value = count of paid_on_time