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 everyone,
I would like to know if it is possible to get the values selected in a slicer and put them in a table ?
In fact, I have a hirerarchical slicer with continents and for each continent a list of values. I would like to get the value selected for a continent and store it in a table, in order to join this table with my raw table.
For example, in my raw table Africa has the value 100, Europe the value 500 and America 400. The user wants to change the values of africa and america.
He chose the value 2000 for africa and 3000 for america, I would like to have a column created next to each row with the values selected. I don't know if it is possible to achieve this ?
Thank you
Solved! Go to Solution.
Hi @Anonymous ,
Refer the below:
base data table:
Slicer:
Step 1,create measure on slicer:
Measure 2 = CALCULATE(SUM(Slicer[value]),FILTER(Slicer,Slicer[Name]=SELECTEDVALUE('Table'[Country])))
Step2,use the measure on base table:
valueqq =
VAR _1 =
EXCEPT ( ALL ( 'Table'[Country] ), ALLSELECTED ( Slicer[Name] ) )
RETURN
IF (
CALCULATE ( IF ( ISFILTERED ( 'Slicer'[Name] ), 1, 0 ), ALLSELECTED ( Slicer ) ) = 0,
[maxvalue],
IF (
CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Country] IN _1 ) ) = 1,
MAX ( 'Table'[value] ),
[Measure 2]
)
)
Output result:
I provided my pbix if you need.
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @Anonymous ,
Refer the below:
base data table:
Slicer:
Step 1,create measure on slicer:
Measure 2 = CALCULATE(SUM(Slicer[value]),FILTER(Slicer,Slicer[Name]=SELECTEDVALUE('Table'[Country])))
Step2,use the measure on base table:
valueqq =
VAR _1 =
EXCEPT ( ALL ( 'Table'[Country] ), ALLSELECTED ( Slicer[Name] ) )
RETURN
IF (
CALCULATE ( IF ( ISFILTERED ( 'Slicer'[Name] ), 1, 0 ), ALLSELECTED ( Slicer ) ) = 0,
[maxvalue],
IF (
CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Country] IN _1 ) ) = 1,
MAX ( 'Table'[value] ),
[Measure 2]
)
)
Output result:
I provided my pbix if you need.
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
Hi @amitchandak,
Thank you for your reply ! But, i would like to display all the lines of my raw table and if a value is selected in the slicer get the new column filled by this value otherwise display nothing.
Thanks
@Anonymous , You can put them in visual table, by having the same column as un summarized field.
You can not use slicer values in a calculate table
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 |
---|---|
108 | |
98 | |
79 | |
67 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |