The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Buenas tardes,
estoy intentando calcular el importe total si la fecha de este importe es anterior al último día de la fecha que se está seleccionando en un filtro de fechas.
El problema está cuando tengo que comparar una columna fecha con la medida que realiza el cálculo de la fecha fin que se esté seleccionando en el filtro.
¿Como podría realizar esta comparación? He intentado cambiar la medida y hacerlo en una columna, pero el valor de fecha fin seleccionada es distinta a la medida, no se ejecuta bien como es lógico.
¿Alguna idea?
Muchas gracias de antemano!
Solved! Go to Solution.
Hi @nandobaeza97 ,
I created some data:
Table:
Slicer_Date:
Here are the steps you can follow:
1. Create measure.
Flag =
var _mindate=MINX(ALLSELECTED(Slicer_Date),[Date])
var _maxdate=MAXX(ALLSELECTED('Slicer_Date'),[Date])
return
IF(
MAX('Table'[Date]) <_maxdate,1,0)
Measure =
SUMX(ALLSELECTED('Table'),[Amount])
2. Place [Flag]in Filters, set is=1, apply filter.
Displays data smaller than the Slicer selection max date
3. Result:
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
Hi @nandobaeza97 ,
I created some data:
Table:
Slicer_Date:
Here are the steps you can follow:
1. Create measure.
Flag =
var _mindate=MINX(ALLSELECTED(Slicer_Date),[Date])
var _maxdate=MAXX(ALLSELECTED('Slicer_Date'),[Date])
return
IF(
MAX('Table'[Date]) <_maxdate,1,0)
Measure =
SUMX(ALLSELECTED('Table'),[Amount])
2. Place [Flag]in Filters, set is=1, apply filter.
Displays data smaller than the Slicer selection max date
3. Result:
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
@nandobaeza97 , Assumed you are using a date table
new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = maxx(filter(all(Table),Table[Date] <_max) , Table[Date]
return
calculate( sum(Table[Value]), filter(all('Date'), 'Date'[Date] =_min))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
90 | |
83 | |
64 | |
58 |
User | Count |
---|---|
244 | |
128 | |
119 | |
82 | |
78 |