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
Marecki
New Member

DAX Calulate columns problem

Hello,

 

I'm brand new to Power BI and still learning about DAX and creating advanced models. I have a small problem. I have a model called Test, and I created two DAX measures. When I use them separately in the model, they work fine. Now I want to create a third DAX measure that subtracts noQuantity from yesQuantity, but when I add it to the dashboard, I get an error without any explanation.

 

yesQuantity = 

CALCULATE(
    COUNTROWS('Test'),
    'Test'[isCalculated] = "Yes"
)
 
noQuantity =
CALCULATE(
    COUNTROWS('Test'),
    'Test'[isCalculated] = "No"
)
 

netQuantity = [YesQuantity] - [NoQuantity]

 

Marecki_0-1741003175880.png

 

6 REPLIES 6
v-sdhruv
Community Support
Community Support

Hi @Marecki ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You

v-sdhruv
Community Support
Community Support

Hi @Marecki ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You

v-sdhruv
Community Support
Community Support

Hi @Marecki ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You

Anonymous
Not applicable

Hi @Marecki 

 

I did some tests, but unfortunately that I can't reproduce your issue, it works well in my side.

vzhengdxumsft_0-1741077552398.png

vzhengdxumsft_1-1741077572330.png

vzhengdxumsft_2-1741077581667.png

vzhengdxumsft_3-1741077592615.png

 

If possible, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@Marecki you should use the exact names of the measures yesQuantity and noQuantity as defined.

netQuantity = [yesQuantity] - [noQuantity]



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

Proud to be a Super User!




LinkedIn






Ye, of course i put names properly in PowerBI. Sorry for that, my mistake when writing post. 

Marecki_0-1741011207861.png  

Marecki_1-1741011260704.png

 

 

Helpful resources

Announcements
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!

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.

Users online (2,117)