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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Sort by Column function influence measure result

Hi All.

Ok, so this is the strangest one, which I came across so far.

First, let me describe the part, which is understable.

 

I have a simple model, which contains one fact table and one dimension table with Account.

KamilSzpyrka_0-1633079871344.pngKamilSzpyrka_1-1633079886992.png

 

Then I've created a measure, which calculates sum of column value for account ZwykleKonto1

 

Measure = CALCULATE(sum(factFact[Value]), dimAccount[Account] = "ZwykleKonto1")
 
When I create a table visual with Account and Measure it looks like below, which is completly reasonable to me (measure filter overwrites context filter).
KamilSzpyrka_2-1633079997362.png

 

Now let's start with the mistic part. When I sort column Account by column Sorter, Measure starts to reflect 0 for Accounts with different Sorter value then 50 (which is value for ZwykleKonto1). I completly do not understand this behavious. Can I ask for explanation please?

 

KamilSzpyrka_3-1633080040962.pngKamilSzpyrka_4-1633080150337.png

 

 

 

Many Thanks, Kamil.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

2 REPLIES 2
Anonymous
Not applicable

After some research I found an article describing this behaviour.

 

https://blog.crossjoin.co.uk/2015/12/15/power-bi-desktop-sort-by-column-and-dax-calculations-that-us...

amitchandak
Super User
Super User

@Anonymous , Try like

Measure = CALCULATE(sum(factFact[Value]),filter( dimAccount, dimAccount[Account] = "ZwykleKonto1"))

 

refer

http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.