Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Dear Experts:
I have got a table visual as follows:
It shows the Top 5 Countries by Category Sales. along with a Ranking Column. It works just fine.
The two measures Top5Countries and Ranking are as follows (please see below). They work just fine everything is ok.
Now here comes my question: How can I retrieve The Total Sales as depicted in the Table Visual (142,171,598 €) and have that value displayed in a card visual.
Help is very much appreciated. Thank you very much in advance. Regards, Andreas
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
In this case, one of ways is using WINDOW and RANK DAX functions in measures.
Please check the below picture and the attached pbix file.
WINDOW function (DAX) - DAX | Microsoft Learn
RANK function (DAX) - DAX | Microsoft Learn
Total sales: =
SUM(sales[sales])
Top 5 countries within category: =
VAR _topn =
WINDOW (
1,
ABS,
5,
ABS,
SUMMARIZE (
ALL ( sales ),
category[category],
country[country]
),
ORDERBY ( [Total sales:], DESC ),
,
PARTITIONBY ( category[category] )
)
RETURN
CALCULATE (
[Total sales:],
KEEPFILTERS ( _topn )
)
Ranking: =
IF (
[Top 5 countries within category:],
RANK (
SKIP,
SUMMARIZE (
ALL ( sales ),
category[category],
country[country]
),
ORDERBY ( [Total sales:], DESC ),
,
PARTITIONBY ( category[category] )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Wow Kim,
I am deeply impressed by your expertise. That's the way I wanted it. Thank you very much for your great help. I really appreciate it.
Best Regards, Andreas
Hi @AndreasHermle,
May i know has your issue been resolved? If the response provided by the community member @Jihwan_Kim, addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.
If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.
Thank you for your understanding!
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
In this case, one of ways is using WINDOW and RANK DAX functions in measures.
Please check the below picture and the attached pbix file.
WINDOW function (DAX) - DAX | Microsoft Learn
RANK function (DAX) - DAX | Microsoft Learn
Total sales: =
SUM(sales[sales])
Top 5 countries within category: =
VAR _topn =
WINDOW (
1,
ABS,
5,
ABS,
SUMMARIZE (
ALL ( sales ),
category[category],
country[country]
),
ORDERBY ( [Total sales:], DESC ),
,
PARTITIONBY ( category[category] )
)
RETURN
CALCULATE (
[Total sales:],
KEEPFILTERS ( _topn )
)
Ranking: =
IF (
[Top 5 countries within category:],
RANK (
SKIP,
SUMMARIZE (
ALL ( sales ),
category[category],
country[country]
),
ORDERBY ( [Total sales:], DESC ),
,
PARTITIONBY ( category[category] )
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
User | Count |
---|---|
17 | |
14 | |
13 | |
13 | |
12 |
User | Count |
---|---|
19 | |
15 | |
15 | |
10 | |
9 |