Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
WBougerra
New Member

Convert KB to TB results show in table but not on visual

Hi, 

I'm trying to convert KB to TB on my dashboard, i found many solutions on internet like using this :

Taille = VAR Kilo =
    SUM ( ExtractionFileSystem[FileSize] ) 
RETURN
    SWITCH (
        TRUE (),
        ABS ( Kilo ) > 2 ^ 50, FORMAT ( DIVIDE ( Kilo, 2 ^ 50 ), "###.00 E" ) = VALUE(MAX()) ,
        ABS ( Kilo ) > 2 ^ 40, FORMAT ( DIVIDE ( Kilo, 2 ^ 40 ), "###.00 Pb" ),
        ABS ( Kilo ) > 2 ^ 30, FORMAT ( DIVIDE ( Kilo, 2 ^ 30 ), "###.00 Tb" ),
        ABS ( Kilo ) > 2 ^ 20, FORMAT ( DIVIDE ( Kilo, 2 ^ 20 ), "###.00 Gb" ),
        ABS ( Kilo ) > 2 ^ 10, FORMAT ( DIVIDE ( Kilo, 2 ^ 10 ), "###.00 Mb" ),
        IF ( ABS ( Kilo ) <> BLANK (), FORMAT ( Kilo, "### Kb" ), BLANK () )
    )

the problem is that on table the results is displayed correctly but not on a visual :

WBougerra_0-1659959133757.png

WBougerra_1-1659959289900.png

 

seems like a result is in varchar or something...

And last please can someone help me to convert that data to TB only ?

 

Thx for help 🙂

 

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

Hi @WBougerra,

 

If you convert your KB to TB by following the formula you attached, then you will get some Text data type values for they are combined by a numeric value and a unit of measurement. And for different visuals, they may have different requirements for the fields that they can receive. But for most visuals, they can receive numeric values.

 

You may try convert your KB to TB by the following Measure or Calculated column. And their results are some numeric values.

Measure: Convert TB = MAX('Table'[KB])*POWER(9.31,-10)   //9.31×10-10 is the conversion value

Calculated column: KB Convert by Calcualted Column = 'Table'[KB]*POWER(9.31,-10)

 

In addition, there are some differences when you calculate by measure or calculate by Calculated column. For more details, you could refer to the following docs and blog.

Measures in Power BI Desktop - Power BI | Microsoft Docs

Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Docs

Calculated Column and Measure in Power BI (powerbiconsulting.com)

 

Here is the sample data and result.

vcazhengmsft_0-1660197408238.png

 

vcazhengmsft_1-1660197408241.png

 

Also, attached the pbix file.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best regards,

Community Support Team _ Caiyun

View solution in original post

1 REPLY 1
v-cazheng-msft
Community Support
Community Support

Hi @WBougerra,

 

If you convert your KB to TB by following the formula you attached, then you will get some Text data type values for they are combined by a numeric value and a unit of measurement. And for different visuals, they may have different requirements for the fields that they can receive. But for most visuals, they can receive numeric values.

 

You may try convert your KB to TB by the following Measure or Calculated column. And their results are some numeric values.

Measure: Convert TB = MAX('Table'[KB])*POWER(9.31,-10)   //9.31×10-10 is the conversion value

Calculated column: KB Convert by Calcualted Column = 'Table'[KB]*POWER(9.31,-10)

 

In addition, there are some differences when you calculate by measure or calculate by Calculated column. For more details, you could refer to the following docs and blog.

Measures in Power BI Desktop - Power BI | Microsoft Docs

Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Docs

Calculated Column and Measure in Power BI (powerbiconsulting.com)

 

Here is the sample data and result.

vcazhengmsft_0-1660197408238.png

 

vcazhengmsft_1-1660197408241.png

 

Also, attached the pbix file.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best regards,

Community Support Team _ Caiyun

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.