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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Valores distintos con filtro de fecha

Hola

Me gustaría un poco de ayuda en la visualización de valores distintos durante un período de tiempo especificado. 'DISTINCT COUNT' funciona perfectamente sin aplicar un filtro. Por ejemplo, supongamos que me gustaría ver tiendas distintas visitadas en la semana 35, debería poder ver ShopE sólo desde ShopB y ShopD se han visitado en la semana 29 y la semana 34 respectivamente.

¿Algún consejo sobre cómo se puede lograr esto?

Shop_idShop_nameDate_VisitedWeek_No
100Tienda14/7/2029
101ShopB15/7/2029
102ShopC22/7/2030
103ShopD17/8/2034
100Tienda21/8/2034
102ShopC13/8/2033
106ShopE29/8/2035
101ShopB23/8/2035
103ShopD25/8/2035
101ShopB14/9/2038
1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Kaskazi_Network

Aquí hay una alternativa (nombre de la tabla 'ShopVisits'):
1) medir para usar en el panel de filtro para filtrar una tabla

Distinct visits = 
VAR PrevVisit = CALCULATETABLE(VALUES(ShopVisits[Shop_name]), 
                FILTER(ALL(ShopVisits[Week_No]), 
                ShopVisits[Week_No] < SELECTEDVALUE(ShopVisits[Week_No])))
VAR Selected = VALUES(ShopVisits[Shop_name])
RETURN
COUNTROWS(EXCEPT(Selected, PrevVisit))

2) medir para enumerar las nuevas tiendas visitadas:

New Shops visited = CONCATENATEX(FILTER(ALL(ShopVisits[Shop_name]), 
                    [Distinct visits] = 1), 
                    ShopVisits[Shop_name], ", ")

Y entiendes esto:

Result.JPG





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

@Kaskazi_Network

Aquí hay una alternativa (nombre de la tabla 'ShopVisits'):
1) medir para usar en el panel de filtro para filtrar una tabla

Distinct visits = 
VAR PrevVisit = CALCULATETABLE(VALUES(ShopVisits[Shop_name]), 
                FILTER(ALL(ShopVisits[Week_No]), 
                ShopVisits[Week_No] < SELECTEDVALUE(ShopVisits[Week_No])))
VAR Selected = VALUES(ShopVisits[Shop_name])
RETURN
COUNTROWS(EXCEPT(Selected, PrevVisit))

2) medir para enumerar las nuevas tiendas visitadas:

New Shops visited = CONCATENATEX(FILTER(ALL(ShopVisits[Shop_name]), 
                    [Distinct visits] = 1), 
                    ShopVisits[Shop_name], ", ")

Y entiendes esto:

Result.JPG





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






That worked perfectly for me, thanks
Greg_Deckler
Super User
Super User

@Kaskazi_Network ¿Tal vez algo como lo siguiente?

Measure = 
  VAR __Min = MIN('Table'[Date])
  VAR __Max = MAX('Table'[Date])
RETURN
  COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER(ALL('Table')[Date_Visited]>=__Min && [Date_Visited]>=__Max),"Shop_name",[Shop_name])))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Kaskazi_Network , Pruebe una medida como

Supongamos que se selecciona una semana

countx(values(Shop_id) , if(distinctcount(Table[Week_No]) ,calculate(distinctcount(Table[Week_No]) , filter(all(Table), Table[Week_No]<-selectedvalue(Table[Week_No])))<-0, blank(),1))

Lo mejor es que te mueves semana a semana mesa

y tratar como

countx(values(Shop_id) , if(distinctcount(Table[Week_No]) ,calculate(distinctcount(Table[Week_No]) , filter(all(Week), Week[Week_No]<-selectedvalue(Week[Week_No])))<-0, blank(),1))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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