The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Here it is a measure to produce the sales of top 2 products. Why is the TopN the products are arranged based on Product[Name]?? Shouldn't it be sorted based on the measure [total]. What is the correct way if i want topN sales in each continent?
@Cyriackpazhe , RankProduct = RANKX(
ALLSELECTED(Product[Name]),
[TotalSales],
,
DESC,
DENSE
)
It must be using measure like this so it is sorting on the basis of Total Sales but listing it product name wise
Proud to be a Super User! |
|
In the topN , he he had written calculate( [total], TopN( 2, products, [total],ASC)) would the result be correct? If i sort by Product[Name], i won't be getting the products with the top sales right
@Cyriackpazhe it sorts the products in ascending order based on the [total] measure, which means it will return the products with the lowest sales instead of the highest. For highest use Desc.
Proud to be a Super User! |
|
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |