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.
Highlighted
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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors