Forum Discussion
Syndicate_Admin
2 years agoAdministrator
Dynamic Payment Term Simulation by Selected Dates
Hello! I have a measure created in dax that doesn't work for me and I need to improve it to make it work for me or for you to tell me what I can change in the model to overcome this problem. ...
Anonymous
2 years agoNot applicable
Hi Syndicate_Admin ,
You can use Enter data to create a table to use as a slicer.
Then use the Switch() function to create a measure to determine if the selected date is within the
Flag =
var _today=TODAY()
var _6months=EOMONTH(_today,-7)
return
SWITCH(
TRUE(),
MAX('Slicer_Table'[Slicer])="3 days"&&MAX('Table'[Date])>=_today-3&&MAX('Table'[Date])<=_today,1,
MAX('Slicer_Table'[Slicer])="6months"&&MAX('Table'[Date])>_6months&&MAX('Table'[Date])<=_today,1,0)
Place [Flag]in Filters, set is=1, apply filter.
Try the following measure:
Simulated Term 1
=
MINX(
FILTER(ALLSELECTED('Query1'),
'Query1'[DIM_REGLA_PLAZO_PAGO[DIAS_PAGO]>-1&&
'Query1'[Dim_RECEPTOR[RECEIVER]=MAX('Query1'[Dim_RECEPTOR[RECEIVER])&&
'Query1'[Dim_EMISOR[MERCADO_EMISOR]=MAX('Query1'[Dim_EMISOR[MERCADO_EMISOR])&& 'Query1'[Dim_FECHA_VENCIMIENTO[FECHA_VENCIMIENTO]]]=MAX('Query1'[Dim_FECHA_VENCIMIENTO[FECHA_VENCIMIENTO]),'Query1'[DIM_REGLA_PLAZO_PAGO[DIAS_PAGO])
If it doesn't meet your desired outcome, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.