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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
aTomov
Frequent Visitor

New to PowerBi - Need help creating a variable/measure .

Hello guys, 

I just started working with PowerBI and I have to make a report, which is calculating the inventory quantities for user selected date. 

I am posting my datamodel, as well as my Measure. 

Screenshot_1.png

this is the measure I am using, but i get error " Too many arguments were passed to the IF function. The maximum argument count for the function is 3". 

/////

Quantity up to date = if(INVENTTRANS[DATEPHYSICAL].[Date] <= VALUES(vDate[vDate].[Date]) && INVENTTRANS[DATEPHYSICAL].[Date] > "01-01-2000";Sum(INVENTTRANS[QTY]);;) 

/////

Anyone has any thoughts?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

If you want to only sum the rows within the selected period, you need to set the measure to something similar:

 

 [Quantity up to date] = CALCULATE(SUM(INVENTTRANS[QTY]), FILTER(INVENTTRANS, INVENTTRANS[DATEPHYSICAL].[Date] <= VALUES(vDate[vDate].[Date] && INVENTTRANS[DATEPHYSICAL].[Date] >= "01-01-2000"))

 

View solution in original post

4 REPLIES 4
aTomov
Frequent Visitor

So basically in the formula i am saying something like

 

if(Datephysical <= vDate  AND datephysical> 01.01.2000; Sum(QTY);)

Anonymous
Not applicable

Hi aTomov,

 

I think your expression syntax should be:

 

if(and(Datephysical <= vDate, datephysical > 01.01.2000), Sum(QTY))

Yep, this is the correct syntax, thank you, but now, When i change the value of vDate, nothing happens to the table.. 

Any ideas?

Anonymous
Not applicable

If you want to only sum the rows within the selected period, you need to set the measure to something similar:

 

 [Quantity up to date] = CALCULATE(SUM(INVENTTRANS[QTY]), FILTER(INVENTTRANS, INVENTTRANS[DATEPHYSICAL].[Date] <= VALUES(vDate[vDate].[Date] && INVENTTRANS[DATEPHYSICAL].[Date] >= "01-01-2000"))

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.