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.
My issue is that I need to use a substring of a text column as one of the filters on a map. I have the measure but can't make it appear on its own without the "real" column field. I've created a set of demo data to illustrate my problem. Suppose I have City, Fruits, and how many Baskets of that fruit combination in my data source.
Then I've created a slicer for one or more fruits which uses SEARCH to determine if that fruit type is present in the baskets - and filters the resutls on my map. PickedFruit is a measure which shows the selected fruit(s) from the slicer, and Fruit is the actual column. I can get the Fruit slicer to work on the map by adding it to the Time area in the Visualizations pane of the report. My issue is that I can't use PickedFruit instead of Fruits, so when I select a city that has the selected fruit in more than one type of basket, my city will have its total divided into all of the various Fruits lists. For my real work report that is a lot of pages and doesn't give the users a real total per city.
Is there anything I can do to get just the substring PickedFruit so I'd get the total of all baskets that have apples in them? Thanks in advance - I'm a self-taught beginner here! 🙂
Solved! Go to Solution.
I am able to download the file, please let me know the output you want
Baskets 3 = CALCULATE ( SUM(FruitBaskets[Baskets] ), ALL( FruitBaskets ))
Baskets 2 =
var selValue = SELECTEDVALUE(Fruits[Fruit])
var t = if (ISFILTERED(Fruits[Fruit])
, CALCULATE( SUM( FruitBaskets[Baskets] ), ALLSELECTED(Fruits[Fruit]), ALLselected(FruitBaskets))
, CALCULATE( SUM( FruitBaskets[Baskets]), all(FruitBaskets) ))
return t
Baskets 1 = CALCULATE( SUM(FruitBaskets[Baskets]), Filter (ALL(FruitBaskets[Fruits]), CONTAINSSTRING(FruitBaskets[Fruits], SELECTEDVALUE(Fruits[Fruit]))
))
I added all three to the tooltip of the map, snapshot image looks as, when I selected the Apples:
Looks like main part of the report, you have accomplished. To understand, share rough pic or output you are expecting and please share the sample pbix.
also, check these threads in case it helps:
https://docs.microsoft.com/en-us/dax/containsstring-function-dax
https://community.powerbi.com/t5/Desktop/Slicer-on-comma-separated-list-of-string/m-p/1403863
Thanks for your reply! I'd like to be able to have one total number of baskets by PickedFruit (instead of the Fruits column) displayed for each city on the map. The pbix file is in Google drive here .
I am able to download the file, please let me know the output you want
Baskets 3 = CALCULATE ( SUM(FruitBaskets[Baskets] ), ALL( FruitBaskets ))
Baskets 2 =
var selValue = SELECTEDVALUE(Fruits[Fruit])
var t = if (ISFILTERED(Fruits[Fruit])
, CALCULATE( SUM( FruitBaskets[Baskets] ), ALLSELECTED(Fruits[Fruit]), ALLselected(FruitBaskets))
, CALCULATE( SUM( FruitBaskets[Baskets]), all(FruitBaskets) ))
return t
Baskets 1 = CALCULATE( SUM(FruitBaskets[Baskets]), Filter (ALL(FruitBaskets[Fruits]), CONTAINSSTRING(FruitBaskets[Fruits], SELECTEDVALUE(Fruits[Fruit]))
))
I added all three to the tooltip of the map, snapshot image looks as, when I selected the Apples:
That's what I needed. Thank you so much!
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.
User | Count |
---|---|
113 | |
97 | |
79 | |
73 | |
56 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |