March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hey there!
I'm currently displaying multiple columns, all calculated by measures, in a table visual:
Product Name | Total Sales | Total Sales MoM | Total Sessions | Total Sessions MoM |
Product1 | 3000 | 50% | 200 | 42% |
Product2 | 4500 | -6% | 200 | 10% |
Those measures are stored in a measure table.
On a card visual for each MoM column, I want to display the MAX value of these columns and the respective "Product Name" as a description.
I already got a solution for showing the maximum number, although I'm not sure if this is the leanest solution:
First attempt with CALCULATE:
Solved! Go to Solution.
Hi @Anonymous
The general pattern you can use for this is
Max Product Name =
MAXX(
TOPN(1, DimProduct, [Total Sales], DESC),
DimProduct[Product Name]
)
Here I'm using a [Total Sales] measure to get the top product but you can use any measure.
Similarly, I'm returning the Product Name here but you can change that to any dimension attribute/column you like.
Hi @Anonymous
The general pattern you can use for this is
Max Product Name =
MAXX(
TOPN(1, DimProduct, [Total Sales], DESC),
DimProduct[Product Name]
)
Here I'm using a [Total Sales] measure to get the top product but you can use any measure.
Similarly, I'm returning the Product Name here but you can change that to any dimension attribute/column you like.
@Anonymous , You can use TOP 1
Top 1 = calculate(Max('DimProduct'[Product Name]),TOPN(1,allselected('DimProduct'[Product Name]),[Sales_TotalSales MoM%],DESC), values('DimProduct'[Product Name]))
In the bold max , you can have measure if you want top1 of any measure based on TOPN function
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
12 | |
9 | |
7 |
User | Count |
---|---|
38 | |
32 | |
24 | |
12 | |
11 |