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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors