The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
¡Buenas tardes a todos!
Tengo un tablero en el cual represento gastos de nomina por ranchos.
Pero reqiero que las graficas y fichas que tengo, se actulicen con un segmentador de datos, pero ese segmentador de datos tiene que modificar de la siguiente manera la infromacion:
1.- Si estoy en el dia 21-02-2022, al momento de seleccionar el segmentador de dia, me tiene que dar toda la informacion del dia anterior.
2.- Si estoy en la semana 7, al momento de seleccionar el segmentador de semana, me tiene que dar toda la informacion de la semana 6.
Asi con el mes y el acumulado seria hasta la fecha en que este actualizado el informe.
Probó algunas funciones, pero aun no encontré la respuesta.
De favor me pudeiran apoyar?
si se requieren mas datos, con gusto lo puedo compartir,
Saludos, quedo atento a sus comentarios.
Solved! Go to Solution.
@Alexis_96 , BAsed on today . no date is selected
yesterday=
var _max = today()-1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'), 'Table'[Date] =_max ) )
MTD=
var _max = if(day(today() )=1 , eomonth(today(),-1), today())
var _min = eomonth(_max,-1)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
LMTD =
var _max1 = if(day(today() )=1 , eomonth(today(),-1), today())
var _max = date(year(_max1),month(_max1)-1, day(_max1))
var _min = eomonth(today(),-2)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
This month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )
Use today if needed
Week =
var _max1 = maxx(allselected('Date'), 'Date'[Date]) // or _max1 = today()
var _stweek = _max1 +-1*WEEKDAY(_max1,2)+1
var _edweek= _max1+ 7-1*WEEKDAY(_max1,2)
return
calculate(sum(Table[Value]), filter(date, Date[Date] >=_stweek && Date[Date] <=_edweek))
// or use all date
//calculate(sum(Table[Value]), filter(all(date), Date[Date] >=_stweek && Date[Date] <=_edweek))
last week =
var _max1 = maxx(allselected('Date'), 'Date'[Date]) // or _max1 = today()
var _stweek = _max1 +-1*WEEKDAY(_max1,2)+1 -7
var _edweek= _max1+ 7-1*WEEKDAY(_max1,2) -7
return
calculate(sum(Table[Value]), filter(all(Date), Date[Date] >=_stweek && Date[Date] <=_edweek))
Check in case you have a date selected
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...
Buenos dias
Gracias por la respuesta.
Solo me genera una duda; estas medidas las asignare a un filtro, para que me cambien todas mis tabals ?
O solo seria asignarlas al campo que corresponde?
@Alexis_96 , BAsed on today . no date is selected
yesterday=
var _max = today()-1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'), 'Table'[Date] =_max ) )
MTD=
var _max = if(day(today() )=1 , eomonth(today(),-1), today())
var _min = eomonth(_max,-1)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
LMTD =
var _max1 = if(day(today() )=1 , eomonth(today(),-1), today())
var _max = date(year(_max1),month(_max1)-1, day(_max1))
var _min = eomonth(today(),-2)+1
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )
This month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )
Use today if needed
Week =
var _max1 = maxx(allselected('Date'), 'Date'[Date]) // or _max1 = today()
var _stweek = _max1 +-1*WEEKDAY(_max1,2)+1
var _edweek= _max1+ 7-1*WEEKDAY(_max1,2)
return
calculate(sum(Table[Value]), filter(date, Date[Date] >=_stweek && Date[Date] <=_edweek))
// or use all date
//calculate(sum(Table[Value]), filter(all(date), Date[Date] >=_stweek && Date[Date] <=_edweek))
last week =
var _max1 = maxx(allselected('Date'), 'Date'[Date]) // or _max1 = today()
var _stweek = _max1 +-1*WEEKDAY(_max1,2)+1 -7
var _edweek= _max1+ 7-1*WEEKDAY(_max1,2) -7
return
calculate(sum(Table[Value]), filter(all(Date), Date[Date] >=_stweek && Date[Date] <=_edweek))
Check in case you have a date selected
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...
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 August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
79 | |
78 | |
47 | |
39 |
User | Count |
---|---|
147 | |
115 | |
65 | |
64 | |
53 |