Forum Discussion

khush19's avatar
khush19
Resolver I
6 years ago
Solved

Multi Language in PUSH dataset

I have a real time Hybrid dataset,When i open that dataset in POWERBI desktop , Most of the options(Enterdata,Getdata,New parameters..) are disabled because of Real Time dataset.

I want to implement MultiLanguage thing in the report.

How to do this?

 

Below thing I tried:

  • While Pushing the data into POWERBI ,I am creating extra column called language and adding text ('en-US,ZH-CN')
  • In the Report,I create measure
Column= SWITCH(
TRUE(),
ISERROR ( FIND ("zh-CN", MIN(RealTimeDataset[Column]))) <>  TRUE(), "柱",
ISERROR ( FIND ("en-US", MIN(RealTimeDataset[Column]))) <>  TRUE(), "Column"
)
  • But the problem is it contain both en-US and zh-CN so through query filter URL when i pass

&filter=Dataset/Column in 'zh-CN'

OR else write this

&filter=Dataset/Column in 'en-US'

 

both gives Chinese.

 

How to do this?

 

  • khush19's avatar
    khush19
    6 years ago

    Hi Yingjie,

     

    Thanks for your time,below is the scenario:

     

    I have a real time Hybrid dataset,When i open that dataset in POWERBI desktop , Most of the options(Enterdata,Getdata,New parameters..) are disabled because of Real Time dataset.As below you can see even i cnt edit query or do modelling

     
     

     

     

    So for example ,

    Malaysia is our Customer and  at admin portal they can select  in which language they want to see financial data (english,Chinese or Malay).

    i can think of 2 option for this ,which i tried:

    1: create 3 powers bi reports with 1 data set ,one in english,then in Chinese and one in Malay 

    Disadvantage :if we have more customers with multi language ,need to create multiple report

     

    2: pass 3 rows in push dataset with different language code,and in query filter url pass the required language code. And in report write DAX to switch based on filter

     

    so in URL will pass :

    &filter=RealTimeDataset/Language eq 'en-us'

    and inside my report will create a measure:

    Payment =

     

    SWITCH (
        TRUE (),DatasetName[Language]="En-US" then "Payment",
    DatasetName[Language]="zh-CH" then "付款")
    below is the way data will be stored in POwerBI dataset


    Disadvange: Push has limit of 200K and and it will have multiple customer data ,i dnt want to fill the limit with unwanted data. 

     

    so if the user want data to be shown in chinese ,it should dispaly :

     

    and if user select english ,then it should display english.

     

    Thanks

     

     

     

5 Replies

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi khush19 ,

    You can modify your calculate column like this:

     

    Column = SWITCH(

        TRUE(),

        ISERROR(FIND("zh-CN",'Table'[Language])) <> TRUE(),"柱",

        ISERROR(FIND("en-US",'Table'[Language])) <> TRUE(),"Column"

    )

     

    When you use filter in URL, you can modify your filter like this:

    ?filter=Table/Language eq 'en-US'

    OR ?filter=Table/Language eq 'zh-CN'

     

     

    The following result may be your expected:

     

    Here is the demo, please try it:

    PBIX 

     

    Best Regards,

    Yingjie Li

     

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

    • khush19's avatar
      khush19
      Resolver I

      Hi Yingjl,

       

      For me same customer can switch between english and chinese.

       

      so for same row i need to store it in Engish and chinese

       

      Column  en-US   A

      柱            zh-CN  A

       

      As in PUSH datset we have limit of 200K,I dnt want to store a single record in 2 rows.

      Is there any way ,i can store the filter value in URL and which using switch in DAX can use it?

      Like in my language column i will add both en-Us,zh_CN such that filter url work but some how i can get that filter value passed from application and based on that value apply switch

      • v-yingjl's avatar
        v-yingjl
        Community Support

        Hi khush19 ,

         

        I'm not certain whether can create table like this or you can provide some sample data

         

        And you want to achieve it by a calculate column or a measure

        Willing to provide further help.

         

        Best Regards,

        Yingjie Li

         

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