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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
sivarajan21
Post Prodigy
Post Prodigy

Create a Dax return statement using its variable arguments

Hi,

 

I am trying to create a dax measure as below:

sivarajan21_0-1724847015582.png

But I am confused how to refer the variable arguments inside the return statement & so its incomplete.

 

Here is the incomplete measure that i tried:

VT_Profile =
VAR _table = SUMMARIZE(Accruals,Accruals[DBName-Point_Id],Accruals[Date],"Switch Units",[Switch Units],"Accrual Unit Source",[Accrual unit source])

RETURN
CALCULATE(SUM(),)

 

My expected dax measure:

I want to sum the switch units argument from virtual (_table) table variable and filter by its argument Accrual unit Source = "Profile" 

Here is the dax below:

VT_Profile =
VAR _table = SUMMARIZE(Accruals,Accruals[DBName-Point_Id],Accruals[Date],"Switch Units",[Switch Units],"Accrual Unit Source",[Accrual unit source])

RETURN
CALCULATE(SUM(_table(Switch Units),_table(Accrual unit source) = "Profile")

 

PFA file here Financial Management -Tanvi Trial - Copy.pbix

 

Thanks in advance!

@SamWiseOwl @Greg_Deckler @marcorusso @jgeddes @Anonymous @Anonymous @amitchandak 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@sivarajan21 you need to use the SUMX function to iterate over the virtual table and sum the "Switch Units" while applying the filter for "Accrual unit source". 

 

dax
VT_Profile =
VAR _table =
SUMMARIZE(
Accruals,
Accruals[DBName-Point_Id],
Accruals[Date],
"Switch Units", [Switch Units],
"Accrual Unit Source", [Accrual unit source]
)
RETURN
CALCULATE(
SUMX(
FILTER(
_table,
[Accrual Unit Source] = "Profile"
),
[Switch Units]
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@sivarajan21 you need to use the SUMX function to iterate over the virtual table and sum the "Switch Units" while applying the filter for "Accrual unit source". 

 

dax
VT_Profile =
VAR _table =
SUMMARIZE(
Accruals,
Accruals[DBName-Point_Id],
Accruals[Date],
"Switch Units", [Switch Units],
"Accrual Unit Source", [Accrual unit source]
)
RETURN
CALCULATE(
SUMX(
FILTER(
_table,
[Accrual Unit Source] = "Profile"
),
[Switch Units]
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.