Forum Discussion

leo124's avatar
leo124
New Member
1 year ago
Solved

Units shown on visuals

Can I set PowerBI to display numbers with commas at the top of the display? So 1 million would be displayed as 1'000 and 700k as 0'700.
  • alish_b's avatar
    1 year ago

    Well you technically could, but then I believe it will be then considered a string as Power BI does not natively support a apostrophe as a separator.
    As per the format you described, I believe you wanted it formatted based on a scale of a million. I have wriiten a basic structure, but you will need to build upon it for cases where more than 100 million or cases where it is less than 100k but it will give you a head start:

    Value with Apostrophe = SUBSTITUTE(
        FORMAT(SUM('Test Data'[Value]) / 1000000, "0.000"),
        ".",
        "'"
    )

    Here is the DAX to build the table to test it with:

    Test Data = 
    DATATABLE(
        "Category", STRING,
        "Value", INTEGER,
        "Description", STRING,
        {
            {"Sales", 1250000, "1.25 million"},
            {"Marketing", 750000, "750 thousand"},
            {"Operations", 2500000, "2.5 million"},
            {"HR", 125000, "125 thousand"},
            {"IT", 3750000, "3.75 million"},
            {"Finance", 500000, "500 thousand"},
            {"Research", 1875000, "1.875 million"},
            {"Support", 625000, "625 thousand"},
            {"Development", 4200000, "4.2 million"},
            {"Training", 300000, "300 thousand"}
        }
    )

    Personally, I would recommend avoiding this but if you really need it, I hope this helps!