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
shantanu97
Helper I
Helper I

Issue with DAX measure calculation

Written a DAX measure but I don't know why it is not showing values? Can anyone help me to fix this error?
 
Cost of goods sold(COGS) = CALCULATE(SUM('OLAP CUBE_Finance_WB'[Amount]), FILTER('OLAP Account','OLAP Account'[AccountCode]=300))
 
1 ACCEPTED SOLUTION

You are right @az38 . Account count is in Text format but when I tried to put " " in DAX so It gives me login credential error.

@shantanu97 , Please put 300 in double quotes because it's a text.

1.PNG2.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

3 REPLIES 3
az38
Community Champion
Community Champion

@shantanu97 

there is access restriction to your OLAPs in attached pbix, but I can suggest that your AccountCode is a text

If so, either change date type to number or use quotas in sentence

Cost of goods sold(COGS) = CALCULATE(SUM('OLAP CUBE_Finance_WB'[Amount]), FILTER('OLAP Account','OLAP Account'[AccountCode]="300"))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

You are right @az38 . Account count is in Text format but when I tried to put " " in DAX so It gives me login credential error.

@shantanu97 , Please put 300 in double quotes because it's a text.

1.PNG2.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Pragati11
Super User
Super User

Hi @shantanu97 ,

 

Looks like your relationships are not right therefore te filter in this measure is not working.

 

Your current relationship: OLAP ACCOUNT to OLAP CUBE FINANCE WB table

But, in your dax you are trying to use filter other way round.

 

Please work on your data model to get the calculations right.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.