Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I have a slicer of list of regions, and some table and graphs showing the indicators for each selected region.
For example, one card showing some country background text, and another visual showing the population.
The regions are Asia, Africa, Europe, etc.
The data behind is quite simple, with Region, Indicator, and Value as columns. Region is a list of regions, indicator is a list of indicators, and value is respective value, e.g. Europe, total population, xbillion.
When a region is selected in the slicer dropdown, the visuals show the data for that region. But when nothing is selected in the filter or selection is cleared, how can I make other graphs display "Europe" data by default?
I would prefer if there is a measure I can put as a filter at the page or visual level, otherwise, a measure conditionally filtering the value?
Note that some values are strings.
Solved! Go to Solution.
Hi @zoffice
I think your data model is as below.
If you want to calculate number you can use measure like Fowmy 's reply.
If you want to retrieve string values you can try my measure.
String =
IF(
ISFILTERED('Table'[Region]),
MAX('Table'[Value-string]),
CALCULATE(
MAX('Table'[Value-string]),
'Table'[Region] = "Europe"
)
)
Result is as below.
By default:
Select Asia:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@zoffice
Please check the below formula and adjust it as per your model.
When no region is selected, it shows the Europe total and
Your Measure =
IF(
ISFILTERED(Table6[Region]),
SUM(Table6[ Value-numerical]),
CALCULATE(
SUM(Table6[ Value-numerical]),
Table6[Region] = "Europe"
)
)
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@zoffice
Not quite sure what you means by "retrieve string values". I assume you have a dimension table with a Region Column.
Please share some sample data based on your model and provide a clear explanation.
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?
How to get your questions answered quickly?
_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I have added some additional columns with text values such as "High-Income", that may not work with SUM i imagine.
My data model structure is basically the following:
Region, Indicator, Value-numerical, value-string
Europe, Population, 1234656, ,
Europe, Income-level, , High-income
Asia, Population, 234567, ,
Asia, Income-Level, , High-income
@zoffice
Try the following measure:
Your Measure =
IF(
ISFILTERED(Table[Region]),
SUM(FactTable[Amount]),
CALCULATE(
SUM(FactTable[Amount]),
Table[Region] = "Europe"
)
)
________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thank you!
How do I retrieve string values?
Hi @zoffice
I think your data model is as below.
If you want to calculate number you can use measure like Fowmy 's reply.
If you want to retrieve string values you can try my measure.
String =
IF(
ISFILTERED('Table'[Region]),
MAX('Table'[Value-string]),
CALCULATE(
MAX('Table'[Value-string]),
'Table'[Region] = "Europe"
)
)
Result is as below.
By default:
Select Asia:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.