Forum Discussion
Measure by buttoms
- 1 year ago
Hi migueldfr ,
Please confirm if this is the preferred way to display the different amounts on the chart. I have attached the PBIX file for your reference. Please let us know if any further details needed.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you!!
Hi migueldfr ,
Thank you for reaching out to Microsoft Fabric Community.
I have created a sample dataset based on your requirements and developed a measure to address the issue. Below measure ensure the values are displayed for the current month, regardless of any other filters applied.
Also attached the pbix file for your reference.
Measure:
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks & Regards,
Rekha,
Customer Support Team!!
Thanks for response.
I am asking what about the others options, what if I select "por meses", this does not show up on the measure
Thank you
- v-sathmakuri1 year agoCommunity Support
Hi migueldfr ,
Thank you for reaching out to Microsoft Fabric Community.
Since your requirement is to fetch values for the current month while ignoring any selection from the master Calendar[Month Name] when 'mes actual hasta hoy' is clicked, the measure below will return the same results. It returns current month values while ignoring the Calendar[Month Name] filter for 'mes actual hasta hoy' and behaves the same as your original measure when other values are selected.
Total_Importe_Cobro_Dinamico =VAR SeleccionUsuario = SELECTEDVALUE(Seleccion_Rango_Fecha[Column1])VAR TodayDate = TODAY()VAR FirstDayOfCurrentMonth = DATE(YEAR(TodayDate), MONTH(TodayDate), 1)VAR Yesterday = TodayDate - 1VAR MesEnContexto = MAX('MasterCalendar'[Month Number])VAR DiaActual = DAY(TODAY()) - 1VAR MesActual = MONTH(TODAY())
RETURNSWITCH(TRUE(),
SeleccionUsuario = "Mes actual hasta hoy",CALCULATE(SUM(CobrosAnx[importe_cobro]),FILTER(ALL('MasterCalendar'),'MasterCalendar'[Date] >= FirstDayOfCurrentMonth &&'MasterCalendar'[Date] <= Yesterday)),
SeleccionUsuario = "Rango de fechas",CALCULATE(SUM(CobrosAnx[importe_cobro]),'MasterCalendar'[Date] >= MIN('MasterCalendar'[Date]) && -- Fecha mínima seleccionada'MasterCalendar'[Date] <= MAX('MasterCalendar'[Date]), -- Fecha máxima seleccionada-- Aseguramos que la fecha de cualquier año seleccionado sea incluida'MasterCalendar'[Year] >= YEAR(MIN('MasterCalendar'[Date])) &&'MasterCalendar'[Year] <= YEAR(MAX('MasterCalendar'[Date]))),-- Opción 3: "Por Meses" (mostrar todo o limitar si es el mes actual)SeleccionUsuario = "Por Meses",CALCULATE(SUM(CobrosAnx[importe_cobro]),'MasterCalendar'[Month Number] = MesEnContexto, -- Mes en contextoIF(MesEnContexto = MesActual, -- Si es el mes actual'MasterCalendar'[Day] <= DiaActual, -- Limitar hasta el día actualTRUE() -- Si es otro mes, mostrar todo)))If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks & Regards,
Rekha,
CustomerSupportTeam.
- migueldfr1 year agoHelper IV
is true that I want to ingoring any selection that has been selected on month name box
But in parallel I want it show me up the right value for the actual month
and now is not working as I expectedThanks
- v-sathmakuri1 year agoCommunity Support
Hi migueldfr ,
Could you please explain your follow up query in details to provide better solution.
Thanks & Regards,
Rekha.