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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
marial16
Helper II
Helper II

Division of two variables

Hallo,

i am facing an issue trying to divide the values of two variables.

I have created a table with Measures for calculations and i initiate a number of variables.

Because i am using different lists i have a common LookUp field and they are connected.

At some point i have to divide two values. It does not seem to work (while adding the values worked for example)

I have tried Divide(val10a,val1) and even val10a/val1.

 

VAR Val1 = Calculate(Sum(MyList[OS]),Filter......)

VAR Val10a = COUNTROWS(FILTER(MyOtherList,List[CategoryID]=1.......)

 

I have tried to write Val10a as Calculate(COUNTROWS(....

or VALUE(COUNTRows(...

 

For some reason i am getting blank or the calculation is not happening . Any ideas?

 

 

 

3 REPLIES 3
marial16
Helper II
Helper II

i created a table with 3 measures. Here same code works.It doesnt work in the switch function

marial16_0-1643032897161.png

 

goncalogeraldes
Super User
Super User

Hello there @marial16 ! Are you using the DIVIDE() function? If so, how are you hanling errors?

yes i tried using the devide function but to see if it works i set the values to be 

 

VAR Val1 =2 

VAR Val10a = 2

 

which would have to return 1 ,but it does not.

 

in the sequence of my code in the Measure i use..

 

RETURN

SWITCH (SELECTEDVALUE(ReportList[ListID]),

1, If(ISNUMBER(Val), Val , 0,

2....

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors