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
Anonymous
Not applicable

Question about VAR Return

Hello everyone,

 

I am confused with this measure. Can anyone please explain?

Add Numeric Distribution111 measure is showing wrong results. it is not filtering any customers.

but Add Numeric Distribution222 is showing right results. Can anyone please explain the reason behind this? I thought these will show same results. 

 

Add Numeric Distribution111 =
VAR __Customers = DISTINCTCOUNTNOBLANK(Answer[CustomerID])
RETURN
CALCULATE(
DIVIDE(
CALCULATE(__Customers, Answer[Actual]=1),
__Customers
)
, CyclePlan[Month]="Current Month"
)

 

Add Numeric Distribution222 =
CALCULATE(
DIVIDE(
CALCULATE(DISTINCTCOUNTNOBLANK(Answer[CustomerID]), Answer[Actual]=1),
DISTINCTCOUNTNOBLANK(Answer[CustomerID])
)
, CyclePlan[Month]="Current Month"
)

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Anonymous 

 

Please see this link, you can find the answer there:

 

https://radacad.com/caution-when-using-variables-in-dax-and-power-bi

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @Anonymous 

 

Please see this link, you can find the answer there:

 

https://radacad.com/caution-when-using-variables-in-dax-and-power-bi

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

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.