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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Allisond
Advocate II
Advocate II

Medida que no calcula los totales

Tengo una Medida que identifica pts con una pérdida wt significativa. Sin embargo, funciona correctamente fila por fila. Necesito las filas totales y el número total de pacientes distintos.
MEDIDA 1 (funciona según lo previsto):
30d SignWtLoss
VAR Pt - SELECTEDVALUE(MSTR_Patient[PatientID])
VAR MaxDate á MAX(Dates[DayDate]) - 35
VAR MinDate á MAX(Dates[DayDate]) - 25
Cambio de VAR : CALCULATE(MAX(Weights_20190901[Lbs.]), DATESBETWEEN(Dates[DayDate], MaxDate, MinDate))
VAR SamePTChange á CALCULATE(MAXX(FILTER(Weights_20190901,Weights_20190901[PatientID] á Pt),Change))
VAR WeightVar á SUMX(Weights_20190901,Weights_20190901[Lbs.])
VAR FirstVisDate á MIN(Dates[DayDate])
VAR LastAdmRtnDate ? CALCULATE(MAX(Weights_20190901[Admit or Rtn Wt Date]),Dates[DayDate] <- FirstVisDate)
VAR Day30MAX - SWITCH(TRUE(), WeightVar á BLANK(),BLANK(),
LastAdmRtnDate >MAX(Dates[DayDate]) - 30, BLANK(), SamePTChange)
VAR WtLosslbs = Day30MAX - WeightVar
VAR WtLossPercent á DIVIDE(WtLosslbs,Day30MAX, BLANK())

devolución
SWITCH(TRUE(),
WtLossPercent >-.05, 1 , 0)
MEDIDA 2 (no funciona según lo previsto):
30dWtLoss Pts distintos ?
SUMX(RESUM(MSTR_Patient, MSTR_Patient[PatientID],
"SignWtLoss",[TEST MEASURE 30d SignWtLoss PTS]),DISTINCTCOUNT(MSTR_Patient[PatientID]))
Mi resultado son los pacientes correctos con pérdida de peso, sin embargo estoy recibiendo todas las filas (así que si un pt tenía muchos wts que se consideraron significativos no es contar cada paciente único. Parece que estoy haciendo algo mal con Measure #2 para obtener el conteo distinto, pero por la vida de mí no puedo averiguar lo que es.
Realmente agradecería cualquier ayuda.
¡Gracias!
2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Pruebe esta expresión de medida en su lugar. Hace referencia a su medida existente (de trabajo). Usted debe obtener un recuento de 1 para cada paciente que cumpla con los criterios.

30dWtLoss Pts distintos ?
SUMX(SUMMARIZE(MSTR_Patient, MSTR_Patient[PatientID]), [30d SignWtLoss])
saludos
palmadita




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Se totaliza fila por fila de esta manera, pero mi total de columna es 0. ¿Hay algo más que necesite agregar?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors