cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Summarize ranked sales

Hi Community!

 

I'm having trouble trying to perform a measure. I need tu summarize sales with sepecific conditions. The conditions are: Sum sales that are more or equal than 1 million and that the sales rank is above 30.

 

The measure that I imagine is something like this:

Ventas Marcas Emergentes +1M = 
CALCULATE(
    'Medidas VentasMPh'[Ventas];
    GROUPBY(
        'Marca';
        'Marca'[Leading Brands]
    );
    FILTER(
        'Medidas VentasMPh';
        'Medidas VentasMPh'[Ventas] >= 1000000
    );
    FILTER(
        'Medidas VentasMPh';
        'Medidas VentasMPh'[Ranking Leading Brand por Ventas] > 30
    )
)

What I notice is the second filter of the rank is not working.

 

The rank measure is:

Ranking Leading Brand por Ventas = 
/* Se rankea Leading Brand por la medida de Ventas (responde al selector de período YTD,MTH,MAT) */

IF(
	'Medidas VentasMPh'[Ventas] <> 0;
	RANKX(
		ALLSELECTED('Marca'[Leading Brands]);
		'Medidas VentasMPh'[Ventas]
	)
)

This rank measure works fine when using in a table with Leading Brands.

 

What should I change to make this work?

 

Thanks in advance.

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Re: Summarize ranked sales

Hi @hfoth,

 

Can you share a dummy sample? 

How about function Summarize? Is [Ventas] a measure or a column?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Resolver I
Resolver I

Re: Summarize ranked sales

Hi @v-jiascu-msft.

 

[Ventas] is a measure:

Ventas = 
SWITCH(
	VALUES(
		'Selector Período'[Período]
	);
	"YTD";
	CALCULATE(
		SUM(
			'Ventas Mensuales'[USD]
		);
		DATESYTD(
			'Período a Analizar'[Fecha]
		);
        USERELATIONSHIP(
            'Producto Compañía'[IdCompania-IdProductoCompania];
            'Ventas Mensuales'[IdCompania-IdProductoCompania]
        )
	);
	"MTH";
    CALCULATE(
        SUM(
            'Ventas Mensuales'[USD]
        );
        USERELATIONSHIP(
            'Producto Compañía'[IdCompania-IdProductoCompania];
            'Ventas Mensuales'[IdCompania-IdProductoCompania]
        )
    );
	"MAT";
	CALCULATE(
		SUM(
			'Ventas Mensuales'[USD]
		);
		DATESINPERIOD(
			'Período a Analizar'[Fecha];
			LASTDATE(
				'Período a Analizar'[Fecha]
			);
			-1;
			YEAR
		);
        USERELATIONSHIP(
            'Producto Compañía'[IdCompania-IdProductoCompania];
            'Ventas Mensuales'[IdCompania-IdProductoCompania]
        )
	)
)

 

Does this help to clarify the situation?

 

Thanks in advance.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Upcoming Events

Community Summit North America – Join Online!

Join this community-driven Power Platform digital event for unbiased support and problem-solving.

Top Solution Authors