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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tharris
Frequent Visitor

Measure changing result when switching from localhost SASS model to live server connection

Hello Community,

 

I have a measure that calculates how many of my vendors make up 80% of my spend. It works perfectly when I am connected through localhost (that's how I created it and tested it), but when I switch to live connection to the server (same model and same environment), that number changes.

 

My measure is as follows:

 

# of Suppliers for 80% of Spend =
VAR temp = SUMMARIZE(Vendor,Vendor[VEND_ID],"% Spend", [% of Total Amount Spend])
VAR temp1 = ADDCOLUMNS(temp,"RANK",RANKX(temp, [% Spend],,DESC,Dense))
VAR temp2 = ADDCOLUMNS(temp1, "Cumulative",SUMX(filter(temp1,[RANK] <= EARLIER([RANK])), [% Spend]))
RETURN
MINX(filter(temp2,[Cumulative]>.8),[RANK])
 
and 
% of Total Amount Spend = DIVIDE(sum('Purchase Order'[PO_LN_PO_LN_TOT_AMT]),calculate(sum('Purchase Order'[PO_LN_PO_LN_TOT_AMT]),ALLEXCEPT('Purchase Order','Purchase Order'[PO_LN_PO_LN_TOT_AMT])))
 
The ecxpected result is 266. I have validated that in many ways. When I switch from localhost to live connect, the result changes to 1 😞 
 
I know some functions will work on localhost, but not live connect, such as distinctcountnoblank... I had another measure I had to modify because of that, but all functions within my measure seems to work on the live server connection, so I can't figure out what is causing this.
 
Please help!
 
Thanks!

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

If I had to guess, it is EARLIER. It is not on the list of supported DAX functions for your scenario:

 

https://docs.microsoft.com/en-us/analysis-services/tabular-models/dax-formula-compatibility-in-direc...

 

Try this:

VAR temp = SUMMARIZE(Vendor,Vendor[VEND_ID],"% Spend", [% of Total Amount Spend])
VAR temp1 = ADDCOLUMNS(temp,"RANK",RANKX(temp, [% Spend],,DESC,Dense))
VAR temp2 = ADDCOLUMNS(temp1, "Cumulative",VAR __Rank = MAX([RANK]) RETURN SUMX(filter(temp1,[RANK] <= __Rank)), [% Spend]))
RETURN
MINX(filter(temp2,[Cumulative]>.8),[RANK])

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

If I had to guess, it is EARLIER. It is not on the list of supported DAX functions for your scenario:

 

https://docs.microsoft.com/en-us/analysis-services/tabular-models/dax-formula-compatibility-in-direc...

 

Try this:

VAR temp = SUMMARIZE(Vendor,Vendor[VEND_ID],"% Spend", [% of Total Amount Spend])
VAR temp1 = ADDCOLUMNS(temp,"RANK",RANKX(temp, [% Spend],,DESC,Dense))
VAR temp2 = ADDCOLUMNS(temp1, "Cumulative",VAR __Rank = MAX([RANK]) RETURN SUMX(filter(temp1,[RANK] <= __Rank)), [% Spend]))
RETURN
MINX(filter(temp2,[Cumulative]>.8),[RANK])

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

thank you a bunch! It worked!!!

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.