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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ValeriaBreve
Post Patron
Post Patron

Issue with measure

Hello,

I am really a beginner in DAX...

I am working with a ticketing system. I have a table that has all ticket details one by one, which is fine.

I would like to build a measure so that I can make a distinct count of the tickets, but when the user selects one row of the above detailed table, it does not resolve to "1" - so the selected ticket - but calculates back the number of tickets for the location, business and year of the selected ticket.

I also have a date table that is related to my tickets table on the date (and is working correctly)

So I came up with:

Count of Tickets = CALCULATE(DISTINCTCOUNT('MIMI Tickets'[Ticket Number]),ALLEXCEPT('MIMI Tickets','MIMI Tickets'[Location],'MIMI Tickets'[Business]),ALLEXCEPT(Date_Table,Date_Table[Year],Date_Table[Date]))
 
But unfortunately it is not working 😞
For whatever reason the business works fine, location is fine, but when I select a year from the year slicer (based on Date_Table[Date], interaction set to filter) it does not filter anything - the count of tickets I have is actually the count of tickets for the whole timeframe.
 
Can somebody point me to what I am doing wrong?
 
Thanks!
Kind regards
Valeria
 
 
 
2 REPLIES 2
Mahesh0016
Super User
Super User

@ValeriaBreve can you please share demo data.
thank you!

 

Hello, all data is confidential and creating an ex. would be very time consuming, I hoped my mistake would be evident from the measure...

I found a lead though. I have tried to use the date/year field from the tickets table directly (not the date table), and then it works. It looks like the part of my measure that is not working is related to the second ALLEXCEPT related to the datetable.

 

Is it not allowed to bring in a related table in ALLEXCEPT? Or to have 2 ALLEXCEPTS in the same calculate? 

 

Thanks  a lot. If it is not solvable as is, I will try to come up with mock data, but it is going to take some time.

 

Thanks!

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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