cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SimonChung_GGGG
Helper III
Helper III

Control de recuento por segmentación de fechas

Hola expertos,

Por favor, encuentre la descarga de PBIX aquí

Hay una medida para calcular "Count", "Units", "Sales", "Margin", los valores serán cambiados por la segmentación de fechas

Value by Class = 

VAR currentClassTable = FILTER(ALLSELECTED('Sales table'[Product]), [Class]= SELECTEDVALUE('Pareto classification'[Product class]))

RETURN 
 SWITCH (SELECTEDVALUE('P&L'[P&L]),
 "Count", COUNTROWS(currentClassTable)
 , "Units" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Units])))
 , "Sales" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Sales])))
, "Margin", SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Margin]))))

Por ejemplo, a continuación, se espera que los productos de fondo círculo a 3, pero no puedo hacer eso, ¿alguien ayudaría, muchas gracias

image.png

4 REPLIES 4
amitchandak
Super User
Super User

@SimonChung_GGGG , Pruebe estos

VAR currentClassTable á FILTER(ALLSELECTED('Sales table'[Product]), [Class] in values('Pareto classification'[Product class]))

O

VAR currentClassTable á FILTER(ALLSELECTED('Sales table'[Product]), [Class] in allselected('Pareto classification'[Product class]))

pero si están relacionados mesa no es necesario hacer esto

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

@amitchandak ¡Muchas gracias! Sin embargo, no funciona, los resultados son los siguientes.

VAR currentClassTable á FILTER(ALLSELECTED('Sales table'[Product]), [Class] in values('Pareto classification'[Product class]))

image.png

VAR currentClassTable á FILTER(ALLSELECTED('Sales table'[Product]), [Class] in allselected('Pareto classification'[Product class]))

image.png

@SimonChung_GGGG, el cálculo del recuento es incorrecto

Tratar

Value by Class = 

VAR currentClassTable = FILTER(ALLSELECTED('Sales table'[Product]), [Class] in values('Pareto classification'[Product class]))

RETURN 
 SWITCH (SELECTEDVALUE('P&L'[P&L]),
 "Count",  SUMX(currentClassTable, CALCULATE(DISTINCTCOUNT('Sales table'[Product])))// COUNTROWS(currentClassTable)
 , "Units" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Units])))
 , "Sales" , SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Sales])))
, "Margin", SUMX(currentClassTable, CALCULATE(SUM('Sales table'[Margin]))))
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

@amitchandak Es trabajo ahora, muchas gracias

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it Out!

Join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors