Forum Discussion

Nitin_Patil's avatar
Nitin_Patil
Frequent Visitor
2 years ago
Solved

Power BI Desktop/Service

This observation is about the Power BI desktop/service.
I have a customer table in a semantic model. It has two columns named Customer ID and Customer Name.
Report users want to view Customer ID and Name together in a slicer.
I created a calculated column using both of the columns.
The customer ID is a number, and the Name is a character. The length of the customer ID varies from 4 digits to 9 digits.
The calculated column is -
Customer = CONCATENATE(CONCATENATE(IF(ISBLANK('Customer'[Customer_ID]), BLANK(),'Customer'[Customer_ID]),REPT(" ",(12 - LEN('Customer'[Customer_ID] )))) , IF(ISBLANK('edw DimCustomer'[Customer_Name]), BLANK(),'edw DimCustomer'[Customer_Name]))
The purpose of the calculated column Customer is to concatenate ID and Name but also to start the names aligned vertically, such as

1002 Customer1002
23456 Customer23456
1234567 Customer1234567

The calculated column looks good in Table View but loses the spacing in the slicer.
How can I handle this in the slicer so it does not lose the dynamic spacing?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Nitin_Patil 

     

    Power BI slicers don't retain the exact formatting of spaces due to their default behavior that ignores additional white space in text strings. This is why the dynamic spacing in the calculated column is lost when used.

     

    You can try padding the Customer ID with leading zeros to ensure that all IDs have the same length, which might help maintain better alignment.

     

    Lastly, you might consider providing feedback to Microsoft on the Power BI community forum as a feature request.

    Home (microsoft.com)

     

     

     

    Best Regards,

    Jayleny

     

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Nitin_Patil 

     

    Power BI slicers don't retain the exact formatting of spaces due to their default behavior that ignores additional white space in text strings. This is why the dynamic spacing in the calculated column is lost when used.

     

    You can try padding the Customer ID with leading zeros to ensure that all IDs have the same length, which might help maintain better alignment.

     

    Lastly, you might consider providing feedback to Microsoft on the Power BI community forum as a feature request.

    Home (microsoft.com)

     

     

     

    Best Regards,

    Jayleny

     

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