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,
I
have the following data:
Slider1 | Slider2 | Date | Value | DateFormated |
# | A | 07.2020 | 12 | 1/7/2020 |
# | B | 07.2020 | 14 | 1/7/2020 |
C1 | A | 07.2020 | 21 | 1/7/2020 |
C2 | A | 07.2020 | 23 | 1/7/2020 |
D1 | B | 07.2020 | 32 | 1/7/2020 |
D2 | B | 07.2020 | 34 | 1/7/2020 |
# | A | 08.2020 | 42 | 1/8/2020 |
# | B | 08.2020 | 44 | 1/8/2020 |
C1 | A | 08.2020 | 55 | 1/8/2020 |
C2 | A | 08.2020 | 35 | 1/8/2020 |
D1 | B | 08.2020 | 46 | 1/8/2020 |
D2 | B | 08.2020 | 65 | 1/8/2020 |
# | A | 11.2019 | 77 | 1/11/2019 |
# | B | 11.2019 | 76 | 1/11/2019 |
C1 | A | 11.2019 | 54 | 1/11/2019 |
C2 | A | 11.2019 | 66 | 1/11/2019 |
D1 | B | 11.2019 | 56 | 1/11/2019 |
D2 | B | 11.2019 | 67 | 1/11/2019 |
I use the measure: ValueMeasure = CALCULATE(SUM('Table'[Value]),'Table'[Slider1]="#")
If I select A or B value at slider2, I get the right result.
However, I get wrong result if I select slicer1 value. For example I should get 55, but it shows 86. So I want to have a better measure that works for both slicers.
I hope it is clearly explained.
Thanks in advance!
Solved! Go to Solution.
Hi @IF
Ok, I didn't understand you well last time.
You have two solutions:
1. Create one additional Slider column based on slider1 and slider2. (If slider1 = #, take slider2, otherwise slider1).
Add a new column as a slider and use it for filtering.
2. Create a measure:
ValueMeasure =
VAR _slider1 = SELECTEDVALUE('Table'[Slider1])
RETURN
IF(ISFILTERED('Table'[Slider1]),
CALCULATE(Sum('Table'[Value]), All('Table'[Slider2])),
CALCULATE(Sum('Table'[Value]), FILTER('Table', 'Table'[Slider1] = "#"))
)
_______________
If I helped, please accept the solution and give kudos! 😀
I have created slicers from a table of measures.
I need help with my selected measureshowing the data rather than the name, is this possible?
i want the card showing Age 31-35 to show the value e.g. 35 instead of the name of the measure.
thank you
I would do another column and replace the data. In this case I would replace "Age 31-35" with "35". You can also change the column for the slicer to display the new column.
Hi @IF
Why do you use the condition 'Table' [Slider1] = "#" in the measure?
When using such a condition, you cannot use Slicer1 because the measure will always calculate for "#".
If you want to dynamically change slicers and show the total, you just need to create a measure SUM ('Table' [Value]) and the values will change dynamically.
Examples:
If you want to include the date as well as a filter, add another slicer or add condition to the measure.
_______________
If I helped, please accept the solution and give kudos! 😀
Hi,
If I delete the part: Table'[Slider1]="#" then, I don't get result for other slicer.
@IF I mocked this up in a PBIX, can you confirm that I did it correctly? Your measure is going to calculate the SUM for # rows always the way it is written. See PBIX below sig. It is odd that the slicer does not seem to be impacting the card visual though.
Hi, It is not working for slicer one 😞
If A (07.2020) is selected I want to see value:12 . If C1 is selected, I want to see value 21.
@IF ,
Please use this file: https://gofile.io/d/4Szfws
You had an issue in the measure code.
_______________
If I helped, please accept the solution and give kudos! 😀
Hi,
I checked the file but it gives wrong number with A value. It should be 12 for 07.2020 but it shows 56. It sums all but, it is not helpful.
All the best
Hi @IF
Ok, I didn't understand you well last time.
You have two solutions:
1. Create one additional Slider column based on slider1 and slider2. (If slider1 = #, take slider2, otherwise slider1).
Add a new column as a slider and use it for filtering.
2. Create a measure:
ValueMeasure =
VAR _slider1 = SELECTEDVALUE('Table'[Slider1])
RETURN
IF(ISFILTERED('Table'[Slider1]),
CALCULATE(Sum('Table'[Value]), All('Table'[Slider2])),
CALCULATE(Sum('Table'[Value]), FILTER('Table', 'Table'[Slider1] = "#"))
)
_______________
If I helped, please accept the solution and give kudos! 😀
Hi,
Thanks a lot. The second way works for me. I already accepted the solution. ps. The only problems is that if I select two from slicer2, I would like to get either total or n/a, etc. 🙂
All the best
Hi,
Thanks for the support. However, this is not working. It shows the same value if I select C1, C2, etc.
All the best
Ismail
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 |
---|---|
114 | |
98 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |