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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Query in DAX

Hello Experts,

 

Could you please advise how do I get the below query results in column or measure?

 

select count(i.incident_id)
from   ATB_Incident i,
       ATB_Disposition d
where  i.Disposition = d.DispositionCode
and    d.Chargable = 'Y'

 

Thanks

1 ACCEPTED SOLUTION

@Anonymous

 

I have an idea 

 

Enter this please and tell me if there is an error or no : 

 

Measure = CALCULATE(COUNT(ATB_Incident[Incident_Id]),ATB_Disposition[Chargable]="Y")

- Quentin

View solution in original post

6 REPLIES 6
quentin_vigne
Solution Sage
Solution Sage

Hi @Anonymous

 

The formula you are looking for will look like this : (You need to have relations betweens your tables)

 

Measure = CALCULATE(COUNT(Incident_id);Dispotion=DispositionCode;Chargable="Y")

It's not 100% exact as I don't really know what your table looks like but if you adapt it, it should work !

 

- Quentin

Anonymous
Not applicable

Thanks @quentin_vigne for your prompt response.

 

But its giving error at ";Dispostion" and at ";Chargable"

 

 

If I just plug the table names in measure it should look like 

 

Measure = CALCULATE(COUNT(ATB_Incident[Incident_Id]);ATB_Incident[Dispotion]=ATB_Disposition[DispositionCode];ATB_Disposition[Chargable]="Y")

 

Please help! Thanks..

@Anonymous

 

 

I read something wrong, my bad.

 

Here is something that should be correct : 

 

Measure = CALCULATE(COUNT(ATB_Incident[Incident_Id]);ATB_Disposition[Chargable]="Y")

Do you have a relation between your two table ? 

 

- Quentin

Anonymous
Not applicable

yes, I have join on tables like

 

ATB_Incident.Disposition = ATB_Disposition.DispositionCode

 

Capture.PNG

 

And query is

 

select count(i.incident_id)
from   ATB_Incident i,
       ATB_Disposition d
where  i.Disposition = d.DispositionCode
and    d.Chargable = 'Y'

 

Please advise, thanks!

@Anonymous

 

I have an idea 

 

Enter this please and tell me if there is an error or no : 

 

Measure = CALCULATE(COUNT(ATB_Incident[Incident_Id]),ATB_Disposition[Chargable]="Y")

- Quentin

Anonymous
Not applicable

Thank you so much @quentin_vigne It worked!!!

 

So I can just go on adding more filter conditons in CALCUALTE dax?

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors