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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Kagechiyo
New Member

different DAX output between SSAS vs Import

hello,

 

i would like to make a accumlative / pareto chart by year-month, in clustered chart.

i also make 2 reports :

A - first i make using import data from DB source directly

then

B - i make the report using SSAS from the DB source

 

so i make the DAX as follow :

//--------
accumulate unit=

var currentmon =
SELECTCOLUMNS('VW_FactDetailUnit',"currmonth",'VW_FactDetailUnit'[month])

var sumtabledax =
SUMMARIZE(
ALLSELECTED('VW_FactDetailUnit'),
'VW_PC_FactDetailVIN'[dDate],
"kumakun", SUM('VW_FactDetailUnit'[Qty]))

var cummulativesum =
SUMX(
FILTER(sumtabledax, MONTH('VW_FactDetailUnit'[dDate]) <= currentmon),
[kumakun]
)

return
cummulativesum
//-------------
 
but the result is not the same..
A - the result is OK it can shown correctly.
but
B - is showing error msg as follow :
"The expression refers to multiple columns. Multiple column cannot be converted to a scalar value."
 
is there any step(s) that i missed for the B report?
thank you in advance for your kind attention / time.
 
best regards,
2 REPLIES 2
Anonymous
Not applicable

Regarding the use of SUMMARIZE... I encourage you to read this: All the secrets of SUMMARIZE - SQLBI, and then regardnig the use of ALLSELECTED, I encourage you to read this: The definitive guide to ALLSELECTED - SQLBI

 

By the way, your "currentmon" can't return more than 1 value because you then use it in an expression with "<=" and this requires a scalar. I don't think SELECTCOLUMNS is the right function to use in this context. There are much better ones. For example, SELECTEDVALUE (supported in DirectQuery).

amitchandak
Super User
Super User

@Kagechiyo , Try a measure like

 

var currentmon =
maxx(allselected('VW_FactDetailUnit'),'VW_FactDetailUnit'[month])

var sumtabledax =
SUMMARIZE(
ALLSELECTED('VW_FactDetailUnit'),
'VW_PC_FactDetailVIN'[dDate],
"kumakun", SUM('VW_FactDetailUnit'[Qty]))

var cummulativesum =
SUMX(
FILTER(sumtabledax, MONTH('VW_FactDetailUnit'[dDate]) <= currentmon),
[kumakun]
)

return
cummulativesum

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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