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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Betty12111
Frequent Visitor

How can I calculate the result from different conditions

Dear Community,

 

Our environment is connected to the Analysis Services cube, so the numeric field cannot be created.

I have this table

transaction dateodd numberProduct numberSales AmountSales volumedivisiongroup
2023/2/8JBCPOC5315151712.83E+125500101111
2023/2/8JBCPOC5315151452.82E+1233744600113
2023/2/8JBCPOC5315118852.92E+12877102114
2023/2/8JBCPOC5315118852.92E+121316103115
2023/2/8JBCPOC5315118852.92E+121681103115
2023/2/8JBCPOC5315118852.92E+121242101112
2023/2/8JBCPOC5315118852.99E+120100113
2023/2/8JBCPOC5315151142.83E+128075103116
2023/2/8JBCPOC5315151442.82E+123500103117
2023/2/8JBCPOC5315151442.82E+1214000401111
2023/2/8JBCPOC5315151112.21E+123270101118
2023/2/8JBCPOC5315119672.82E+123500101118
2023/2/8JBCPOC5315119672.82E+1217500503116
2023/2/8JBCPOC5315151552.82E+12252002000113
2023/2/8JBCPOC5315151142.83E+125600203115
2023/2/8JBCGV11111143972.83E+1223275703119
2023/2/8JBCGV11111143973.00E+120103

119

 

How can I calculate the result from different conditions

Number of odd number 

intervalby division=01by group=118
0-99900
1000-199910
2000-299900
3000-399921
4000-499900
5000-599910
6000up11

 

like

Betty12111_0-1678773807658.png

 

 

Betty12111_0-1678773341827.png

 

Is it possible to do this in BI Desktop?
Or I can only create fields in DW.


Any help would be greatly appreciated. 

2 ACCEPTED SOLUTIONS
v-shex-msft
Community Support
Community Support

Hi @Betty12111,

Did you work with the live connection mode? If that is the case, you can't create column/table expression in power bi side.
It means you need to create the segment fields and table on your data source side. Then you can write measure expression to calculate based on current segmentation groups.

Dynamic segmentation – DAX Patterns

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

HI @Betty12111,

In fact, create the segment table on your data source side should be similar as create common tables. It can be designed with three fields: 'segment name', 'range start', 'range end'.

After you finish getting data to power bi side, you can create measure formula to lookup the segment name to get correspond ranges for calculation.(the measure result will dynamically change when you modify the table segment range settings on the data source side)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Betty12111,

Did you work with the live connection mode? If that is the case, you can't create column/table expression in power bi side.
It means you need to create the segment fields and table on your data source side. Then you can write measure expression to calculate based on current segmentation groups.

Dynamic segmentation – DAX Patterns

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

hi @v-shex-msft , Can I create a dynamic table in the live connection mode?
I am using SQL Server Analysis Services(SSAS).
Can this be done in Cube?

HI @Betty12111,

In fact, create the segment table on your data source side should be similar as create common tables. It can be designed with three fields: 'segment name', 'range start', 'range end'.

After you finish getting data to power bi side, you can create measure formula to lookup the segment name to get correspond ranges for calculation.(the measure result will dynamically change when you modify the table segment range settings on the data source side)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I appreciate your help very much.😊

it worked successfully.

Betty12111_0-1679447945954.png

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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