Forum Discussion
Summation for Different Data Types in same Column !
- 6 years ago
Try creating new column like
GB Value = SWITCH ( TRUE (), [Data_type] = "MB", Total_data/1024, [Data_type] = "KB", Total_data/1024/1024, [Data_type] = "TB",Total_data*1024, Total_data )Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin - 6 years ago
Hi, Anonymous
Based on my description, you may create a calculated column as follows.
GB column 1 = IF( 'Table'[Date_type] = "B", 'Table'[Total_data]/1024/1024/1024, IF( 'Table'[Date_type] = "KB", 'Table'[Total_data]/1024/1024, IF( 'Table'[Date_type] = "MB", 'Table'[Total_data]/1024, IF( 'Table'[Date_type] = "GB", 'Table'[Total_data], IF( 'Table'[Date_type] = "TB", 'Table'[Total_data]*1024 ) ) ) ) ) OR GB column 2 = SWITCH( TRUE(), 'Table'[Date_type] = "B",'Table'[Total_data]/1024/1024/1024, 'Table'[Date_type] = "KB",'Table'[Total_data]/1024/1024, 'Table'[Date_type] = "MB",'Table'[Total_data]/1024, 'Table'[Date_type] = "GB",'Table'[Total_data], 'Table'[Date_type] = "TB",'Table'[Total_data]*1024, BLANK() )Then you could create a measure as below.
SumTotalData = CALCULATE( SUM('Table'[GB column 1]), FILTER( ALLSELECTED('Table'), 'Table'[Formated Year] = MAX('Table'[Formated Year]) ) )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try creating new column like
GB Value =
SWITCH (
TRUE (),
[Data_type] = "MB", Total_data/1024,
[Data_type] = "KB", Total_data/1024/1024,
[Data_type] = "TB",Total_data*1024,
Total_data
)
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin