cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SarikaKumari18
Helper III
Helper III

Need guidance on how to handle the dynamic text alignment based on selected value

Can someone please guide me how to change the text alignment based on selectedvalue.

In report , I have Language Type slicer which has Hebrew,Engligh etc. and we have table with question and responses which need to aligned based on language Type.
In case of Hebrew, text should be aligned from right to left as they read and write from right to left. However, english should be from left to right.

Also, is there a way to change the direction of text and not reverse the text. (SQL solution will also help )
For example :
Text :This is test report
Output : report test is this 

Thanks in Advance!

1 ACCEPTED SOLUTION
v-polly-msft
Community Support
Community Support

Hi @SarikaKumari18 , 

Does that make sense? If so, kindly mark my answer as the solution to close the case and help more people find the answer please.  Thanks in advance.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-polly-msft
Community Support
Community Support

Hi @SarikaKumari18 , 

Does that make sense? If so, kindly mark my answer as the solution to close the case and help more people find the answer please.  Thanks in advance.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-polly-msft
Community Support
Community Support

Hi @SarikaKumari18 ,

Power BI Desktop does not support this feature at the moment. Please vote here: Right to left full support 

 

You can only change the order in Power Query. I have alse found a video about it, please refer to it to see if it helps you.

Use PowerQuery to Change the Order of Cell Values or Text 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-polly-msft Thanks for the information , I have voted for right to left support.

v-polly-msft
Community Support
Community Support

Hi @SarikaKumari18 ,

Please refer to my pbix file to see if it helps you.

vpollymsft_0-1646724653167.png

Firstly, spilt the column.

vpollymsft_1-1646724708515.png

Then Unpivot the columns.

vpollymsft_2-1646724823105.png

Thirdly, Added index.

vpollymsft_3-1646724919445.png

Fourthly, sort rows.

vpollymsft_0-1646725128181.png

Then transpose the table.

vpollymsft_1-1646725206977.png

And next is removing top rows.

vpollymsft_2-1646725268081.png

Then change the type to text.

Finally, select all the columns and then right click to choose merge columns.

vpollymsft_3-1646725374322.png

vpollymsft_4-1646725387104.png

Or please refer to my code.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCsnILFYAopLU4hKFotSC/KISpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [column = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"column", type text}}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "column", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), {"column.1", "column.2", "column.3", "column.4"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"column.1", type text}, {"column.2", type text}, {"column.3", type text}, {"column.4", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type1", {}, "Attribute", "Value"),
    #"Added Index" = Table.AddIndexColumn(#"Unpivoted Columns", "Index", 1, 1, Int64.Type),
    #"Reordered Columns" = Table.ReorderColumns(#"Added Index",{"Attribute", "Index", "Value"}),
    #"Sorted Rows" = Table.Sort(#"Reordered Columns",{{"Index", Order.Descending}}),
    #"Transposed Table" = Table.Transpose(#"Sorted Rows"),
    #"Removed Top Rows" = Table.Skip(#"Transposed Table",2),
    #"Changed Type2" = Table.TransformColumnTypes(#"Removed Top Rows",{{"Column1", type text}}),
    #"Merged Columns" = Table.CombineColumns(#"Changed Type2",{"Column1", "Column2", "Column3", "Column4"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged")
in
    #"Merged Columns"

 

 

If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-polly-msft , Thanks very much for your response.
Actually, I have to do this for one particular language (Hebrew) and also apply right alignment on column. I was thinking if we can do something with DAX measure where I can just write if Hebrew language is selected then transform the text and also apply right alignment .

In report , I have Language Type filter and Table chart.


Please let me know if we can achieve using this approach .
I really appreciate your time and effort.
Thanks a lot

amitchandak
Super User
Super User

@SarikaKumari18 , I doubt we have control of text alignment based on the selection

 

 

refer multilingual solutions, if needed  :
https://www.powerbi-pro.com/en/creating-multilingual-reports-in-power-bi/
https://community.powerbi.com/t5/Desktop/How-to-create-Multilingual-Report-in-Power-BI/td-p/599696
https://www.youtube.com/watch?v=JJryD2dXVVw



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Thanks for your response @amitchandak . 
I will take a look the link you have shared .Basically, I want to avoid creating bookmark (we have more than 10  langauges ) and achieve this in existing report.

Any idea about the below request 
Also, is there a way to change the direction of text and not reverse the text. (SQL solution will also help )
For example :
Text :This is test report
Output : report test is this 

Thanks,
Sarika

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors