- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Measures- Multiple Fields Criteria
Hi
I wondered if anyone can help me - I am new to DAX - I am trying to create a measure with multiple critieria - I want to count the number of records - Table Name is Main Claim Data - the field i want to count is ClaimRef, where the field ClassOfBusiness = PL and the Department = Highways and the StatusFlag = CLOSED
I know how to count with one criteria but unsure with multiple - please can someone help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Category =
SWITCH (
TRUE,
'Main Claim Data'[ClassOfBusiness] = "PL"
&& 'Main Claim Data'[Department] = "Highways"
&& 'Main Claim Data'[StatusFlag] = "CLOSED", "Highways PL",
'Main Claim Data'[ClassOfBusiness] = "PL"
&& 'Main Claim Data'[Department] <> "Highways"
&& 'Main Claim Data'[StatusFlag] = "CLOSED", "Other PL",
'Main Claim Data'[ClassOfBusiness] = "EL"
&& 'Main Claim Data'[StatusFlag] = "CLOSED", "EL",
"Others"
)
A category "Others" will polute your report. The easiest way to get red of it is to create a slicer of the category column and select the options you need and deselect "Others".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi - It was my fault, it was Highway Maintenance not Highways.
THis is sorted and I really appreciate all your help - Unbelievable !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Brilliant - are you able to tell me the coding that would create each column as I havent done a calculated column and dragged it into a a table before - based on information below - I really do appreciate your help with this.
Measure Highways PL
Table Name is Main Claim Data - I need them to filter the records where the field ClassOfBusiness = PL and the Department = Highways and the StatusFlag = CLOSED
Other PL
Table Name is Main Claim Data - I need them to filter the records where the field ClassOfBusiness = PL and the Department IS NOT Highways and the StatusFlag = CLOSED
EL
Table Name is Main Claim Data - I need them to filter the records where the field ClassOfBusiness = EL and and the StatusFlag = CLOSED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Category =
SWITCH (
TRUE,
'Main Claim Data'[ClassOfBusiness] = "PL"
&& 'Main Claim Data'[Department] = "Highways"
&& 'Main Claim Data'[StatusFlag] = "CLOSED", "Highways PL",
'Main Claim Data'[ClassOfBusiness] = "PL"
&& 'Main Claim Data'[Department] <> "Highways"
&& 'Main Claim Data'[StatusFlag] = "CLOSED", "Other PL",
'Main Claim Data'[ClassOfBusiness] = "EL"
&& 'Main Claim Data'[StatusFlag] = "CLOSED", "EL",
"Others"
)
A category "Others" will polute your report. The easiest way to get red of it is to create a slicer of the category column and select the options you need and deselect "Others".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
We are nearly there but I have no Highways PL column only Other PL and EL as on diagram. I have put the slider in as suggested. How do I get Highways PL please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is because no of you records matches its conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi - It was my fault, it was Highway Maintenance not Highways.
THis is sorted and I really appreciate all your help - Unbelievable !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just reviewing this . I dont want to count the records as they are already being counted by the Mesaures in the row - if you see on the attached (green table) I have set up a matrix but need the matrix to have the headers Highways PL Other PL EL
What I think I need are measure that filter the colum records as follows-
Measure Highways PL
Table Name is Main Claim Data - I need them to filter the records where the field ClassOfBusiness = PL and the Department = Highways and the StatusFlag = CLOSED
Other PL
Table Name is Main Claim Data - I need them to filter the records where the field ClassOfBusiness = PL and the Department IS NOT Highways and the StatusFlag = CLOSED
EL
Table Name is Main Claim Data - I need them to filter the records where the field ClassOfBusiness = EL and and the StatusFlag = CLOSED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @spandy34
Can you share the code of your measures? Is the green table from power bi?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes the green table is from Power Bi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@goncalogeraldes I have had this resolved now but thank you for responding. Much appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok Then you need to create a calulated column that delivers the 3 categories (Highways PL, Other PL & EL) based on your condition with simple IF statements.
Then drag the new column into your matrix's culmns

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
08-09-2024 03:01 PM | |||
06-09-2024 11:39 AM | |||
05-08-2024 01:55 PM | |||
04-17-2024 02:01 PM | |||
08-02-2024 01:25 AM |
User | Count |
---|---|
24 | |
12 | |
10 | |
10 | |
8 |
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
10 |