Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Tratando de mostrar % de diferencia sobre la cantidad anterior de días filtrados

Así que tengo un gráfico que muestra a los usuarios a lo largo del tiempo, y estoy tratando de agregar una diferencia porcentual durante el número de días que la segmentación de datos ha filtrado. Así que, por ejemplo, si lo tengo establecido que muestra del 1 al 10 de noviembre me mostrará la diferencia % del 21 al 31 de octubre si eso tiene sentido. He estado tratando de usar el KPI visual, pero no sé si es correcto.

Gracias

Kieran L.

3 REPLIES 3
v-jingzhang
Community Support
Community Support

No @klehane

Podrías crear medidas como

Present Total = SUM('Sample'[Cost])
Previous Total = 
VAR minDate = MIN('Sample'[Date])
VAR maxDate = MAX('Sample'[Date])
VAR dates = DATEDIFF(minDate,maxDate,DAY) + 1
VAR previousMinDate = minDate - dates
VAR previousMaxDate = maxDate - dates
RETURN
CALCULATE(SUM('Sample'[Cost]),DATESBETWEEN('Sample'[Date],previousMinDate,previousMaxDate))
Difference % = DIVIDE([Present Total] - [Previous Total],[Previous Total])

Si solo desea mostrar el valor % de diferencia, puede usar un objeto visual tarjeta y poner la medida % de diferencia en él.

122405.jpg

Por favor, hágamelo saber si esto ayuda.

Equipo de apoyo a la comunidad _ Jing Zhang
Si este post ayuda, considera Aceptarlo como la solución para ayudar a otros miembros a encontrarlo.

amitchandak
Super User
Super User

@klehane , Probar fórmula como

Mismo intervalo de fechas último período ?
var _diff á datediff(MIN('Date'[date]),max('Date'[date]),DAY)
var _p_st_date á MINX('Date',DATEADD('Date'[date],-1*_diff,Day))-1
var _p_end_date á MAXX('Date',DATEADD('Date'[date],-1*_diff,Day))-1
devolución
CALCULATE(sum(Sales[Sales Amount]),all('Date'[date]),'Date'[date]>'_p_st_date && 'Date'[date]<' _p_end_date
)

O


Mismo intervalo de fechas último período ?
var _diff á datediff(MIN('Date'[date]),max('Date'[date]),DAY)
var _p_st_date á MINX('Date',DATEADD('Date'[date],-1*_diff,Day))-1
var _p_end_date á MAXX('Date',DATEADD('Date'[date],-1*_diff,Day))-1
devolución
CALCULATE(sum(Sales[Sales Amount]),dateadd('Date'[date],-1*_diff,Day)

parry2k
Super User
Super User

@klehane puede poner un archivo pbix de muestra y compartirlo aquí usando onedrive / google drive, le ayudará a proporcionar una solución.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.