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.
Hi Guys,
I have the challenge that I need to show the dynamic total in a separeted column according to a slicer.
For example if I filter 2 countries I need to show the total for these two countries. The reson is because I need this total to be a dynamic denominator for future calculations.
Please see the sample below:
Filter: Selected Australia and Singapore = total of 10
Country | Value | Total Dynamic Colum |
Australia | 5 | 10 |
New Zealand | 3 | 10 |
Singapore | 5 | 10 |
Total | 13 | 10 |
Slicer: Selected New Zealand and Singapore = total of 8
Country | Value | Total Dynamic Colum |
Australia | 5 | 8 |
New Zealand | 3 | 8 |
Singapore | 5 | 8 |
Total | 13 | 8 |
Is there anyway to achieve this with DAX?
Thanks!!
Solved! Go to Solution.
Hi @fabdata1207 ,
A calculated column is static, it won't change for slicer selection.
You may try a measure instead.
First you need to create a separate country table for the slicer to select. This country table cannot have a relationship with the main table.
A calculated table:
Country=DISTINCT('Table'[Country])
Then, create a measure.
Total Dynamic Measure = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),[Country] in ALLSELECTED(Country[Country])))
You can check more details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @fabdata1207 ,
A calculated column is static, it won't change for slicer selection.
You may try a measure instead.
First you need to create a separate country table for the slicer to select. This country table cannot have a relationship with the main table.
A calculated table:
Country=DISTINCT('Table'[Country])
Then, create a measure.
Total Dynamic Measure = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),[Country] in ALLSELECTED(Country[Country])))
You can check more details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes. Create a disconnected table with the values of interest with the DISTINCT or VALUES function, and use that new table/column in your slicer. You can then use an expression like this to get your dynamic total.
Selected Total =
VAR sel =
DISTINCT( SlicerTable[Country] )
RETURN
CALCULATE(
SUM( table[Value] ),
ALL( Table[Country] ),
Table[Country] IN sel
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
56 | |
38 | |
34 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |