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
Andshepch
Advocate II
Advocate II

Sort By affecting Measure Results

Hi,

 

I have a problem where I have a measure that works fine in a table, but when I apply a Sort By in the Data View the measure stops working.

 

I have the following 4 measures

SBU Win Rate = 
SUM ( 'SBU Sold inc Totals'[Sold CV €M] )
    / (
        SUM ( 'SBU Sold inc Totals'[Sold CV €M] )
            + SUM ( 'SBU LDQ inc Totals'[LDQ CV €M] )
    )

SBU Rolling 12 Month Win Rate = 
CALCULATE (
    [SBU Win Rate],
    '4 Calendar'[Date]
        >= DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), 1 )
        && '4 Calendar'[Date] < DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
)

SBU Rolling WinRate GBL CIS = 
CALCULATE (
    [SBU Rolling 12 Month Win Rate],
    'BU Mapping'[Summary Group Indent] = "GBL CIS")

SBU Rolling 12 Win Rate vs GBL CIS = 
DIVIDE (
    [SBU Rolling 12 Month Win Rate],
    [SBU Rolling WinRate GBL CIS],
    BLANK ()
)

 

 

The desired outcome is to divide each value of the 12 month rolling win rate for Summary Group Indent, by the value where Summary Group Indent = "GBL CIS" i.e. to compare all other win rates against GBL CIS. (compare SBU Rolling 12 Month Win Rate with SBU Rolling WinRate GBL CIS) - this works fine as per the below table - but I need to sort the Summary Group Indent by a sorting index which is in a related table "BU Mapping" using Sort by Column in the Data view - the minute I do this, my results disappear, except for the numbers on the GBL CIS line. I have found similar problems to this and it looks liek I should be using All() to fix it, but I'm afraid I can't work out how, so any help would be greatly appreciated - thanks!

 

Summary Group IndentSBU Win RateSBU Rolling 12 Month Win RateSBU Rolling WinRate GBL CISSBU Rolling 12 Win Rate vs GBL CIS
Double Count100.00%100.00%63.02%1.59
Elimination100.00%100.00%63.02%1.59
    -Germany57.48%86.12%63.02%1.37
    -Insurance80.00%85.27%63.02%1.35
    -France72.20%79.51%63.02%1.26
    -CE60.83%73.70%63.02%1.17
SBU FS56.78%67.59%63.02%1.07
    -North America55.14%66.25%63.02%1.05
SBU Americas & APAC55.38%65.49%63.02%1.04
SBU Europe59.08%63.10%63.02%1.00
GBL CIS56.79%63.02%63.02%1.00
    -UK56.39%60.77%63.02%0.96
    -Netherlands60.65%58.30%63.02%0.93
    -Banking39.51%56.67%63.02%0.90
    -APAC59.51%55.08%63.02%0.87
    -Scandinavia57.18%40.30%63.02%0.64
    -Spain51.13%39.30%63.02%0.62
     
     
     
     
     
1 ACCEPTED SOLUTION

Hi @Andshepch ,

I made the below updates in your sample pbix file, please check whether that is what you want:

1. Select the field [Summary Group Indent] of table BU Mapping and sort by field [BU Order]

2. Update the formula of measure [SBU Rolling WinRate GBL CIS] as below

SBU Rolling WinRate GBL CIS = 
CALCULATE (
    [SBU Rolling 12 Month Win Rate], 
      FILTER(ALL('BU Mapping'),'BU Mapping'[Summary Group Indent] = "GBL CIS"))

Sort By affecting Measure Results.JPG

Best Regards

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

View solution in original post

4 REPLIES 4
Andshepch
Advocate II
Advocate II

Perfect! Thank you.

v-yiruan-msft
Community Support
Community Support

Hi @Andshepch ,

Please review the solution in the following threads, hope they can help resolve the problem.

Sort By Column changes the Measure results

Side effects of the Sort By Column setting in DAX

If the above solutions not working for you, please provide some sample table in tables which refers in 4 measures and desired result with examples. It is better if you can share your sample pbix file in order to provide a suitable solution. Thank you.

Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

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

Hi there,

 

Thank you so much for your reply, I had read both of those articles and still could not fix my problem. I have attached a link to a sample PBIX file which demonstrates what I am trying to do. Any pointers you can give me woudl be greatly appreciated.

 

https://www.dropbox.com/s/y78hrwpdrwzr6nk/Test%20Rolling%2012.pbix?dl=0 

 

Thanks!

 

Andrew

Hi @Andshepch ,

I made the below updates in your sample pbix file, please check whether that is what you want:

1. Select the field [Summary Group Indent] of table BU Mapping and sort by field [BU Order]

2. Update the formula of measure [SBU Rolling WinRate GBL CIS] as below

SBU Rolling WinRate GBL CIS = 
CALCULATE (
    [SBU Rolling 12 Month Win Rate], 
      FILTER(ALL('BU Mapping'),'BU Mapping'[Summary Group Indent] = "GBL CIS"))

Sort By affecting Measure Results.JPG

Best Regards

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

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.