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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
TKray23
Regular Visitor

need help with dax

currently, i have a table with columns: RecordID, Filter1, Filter2, Col_A, Col_B,...

LIST OF UNIQUE RECORDS = IF((TABLE1[FILTER1]=1), TABLE1[FILTER2],0)

it gives me NON UNIQUE list of records because Filter 2 has values 1 and 0.

I need to modify this statement to list only those RECORDIDs where FILTER2=1

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @TKray23 ,

 

I suggest you to try code as below to create a measure.

Count =
VAR _SUMMARIZE =
    ADDCOLUMNS (
        'Table',
        "DISCOUNTFILTER2",
            CALCULATE (
                DISTINCTCOUNT ( 'Table'[Filter 2(1,0)] ),
                ALLEXCEPT ( 'Table', 'Table'[Record id] )
            )
    )
RETURN
    COUNTX ( FILTER ( _SUMMARIZE, [DISCOUNTFILTER2] = 1 ), [Filter 1] )

Result is as below.

vrzhoumsft_0-1695018476534.png

 

Best Regards,

Rico Zhou

 

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

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

Thanks for the valuable feedback. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@TKray23 Thanks for the explanation but this is useless.  I hope someone else can assist. 

 

You don't need to write in capital letters, follow some forum etiquette. Thank you!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Sorry, haven't realized I had my Caps on, but your deminer is not very friendly either.

parry2k
Super User
Super User

@TKray23 not really clear what you are trying to achieve.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

i NEED TO COUNT ONLY THOSE RECORDS THAT SHOWING UP ONLY ONCE IN FILTER2

TKray23
Regular Visitor

Record id

Filter 1

Filter2(1,0)

a

1

0

a

1

1

b

1

1

c

1

1

d

1

0

d

1

1

 

mesure should : if distinct count of recordid =1, than count Filtert1

 

Count=2

Anonymous
Not applicable

Hi @TKray23 ,

 

I suggest you to try code as below to create a measure.

Count =
VAR _SUMMARIZE =
    ADDCOLUMNS (
        'Table',
        "DISCOUNTFILTER2",
            CALCULATE (
                DISTINCTCOUNT ( 'Table'[Filter 2(1,0)] ),
                ALLEXCEPT ( 'Table', 'Table'[Record id] )
            )
    )
RETURN
    COUNTX ( FILTER ( _SUMMARIZE, [DISCOUNTFILTER2] = 1 ), [Filter 1] )

Result is as below.

vrzhoumsft_0-1695018476534.png

 

Best Regards,

Rico Zhou

 

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

parry2k
Super User
Super User

@TKray23 Paste some data with the expected output. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.