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.
I have a filter Nombre/Montant in the static_table_filter[filter_name] :
If I select Nombre it will get the Montant measure, if I select Montant it will get the Montant measure
SwitchFilter = var selected = SELECTEDVALUE(static_table_filter[filter_name]) var Nombre = 'Measure'[Nombres] var Montant = 'Measure'[Montant] var result = switch(true(), selected= "Nombre", Nombre, selected= "Montant",Montant ) return result
I am putting the SwitchFilter in a stacked bar chart like below adding a column category :
I want when I select Montant the formatting in the chart will be in euros (adding a symbol €) and when I select Nombre the formatting will be in K like for example 5000 becomes 5K. How can I reach that ?
I am using a live connection to an SSAS tabular cube.
Solved! Go to Solution.
It is possible to filter measures by slicer .But when display the value in Stacked bar chart , there is no way to dynamically change the text part of the X axis . I provided the steps , you can refer to them.
(1)Create a slicer table with measure name and corresponding value .For example :
(2) Then create two measures to associate the measure name with the value of the data table .
Montant = if(SELECTEDVALUE(Slicer[Slicer value])=1 || ISBLANK(SELECTEDVALUE(Slicer[Slicer value])),SELECTEDVALUE('Data'[Value]))
Nombre =
var _format=SELECTEDVALUE('Data'[Value])/1000
return
IF(SELECTEDVALUE(Slicer[Slicer value])=2 ||ISBLANK(SELECTEDVALUE(Slicer[Slicer value])),_format)
(3)Set data format for these two measures in Model view .
If you don’t know how to set , you can refer to the link below .
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings
(4)Add a slicer with ‘Slicer’[Select Measure] and stacked bar chart with two measures .
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It is possible to filter measures by slicer .But when display the value in Stacked bar chart , there is no way to dynamically change the text part of the X axis . I provided the steps , you can refer to them.
(1)Create a slicer table with measure name and corresponding value .For example :
(2) Then create two measures to associate the measure name with the value of the data table .
Montant = if(SELECTEDVALUE(Slicer[Slicer value])=1 || ISBLANK(SELECTEDVALUE(Slicer[Slicer value])),SELECTEDVALUE('Data'[Value]))
Nombre =
var _format=SELECTEDVALUE('Data'[Value])/1000
return
IF(SELECTEDVALUE(Slicer[Slicer value])=2 ||ISBLANK(SELECTEDVALUE(Slicer[Slicer value])),_format)
(3)Set data format for these two measures in Model view .
If you don’t know how to set , you can refer to the link below .
https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings
(4)Add a slicer with ‘Slicer’[Select Measure] and stacked bar chart with two measures .
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @amirabedhiafi ,
This can be achieve using the calculated groups check the link below.
https://www.sqlbi.com/articles/controlling-format-strings-in-calculation-groups/
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
107 | |
98 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |