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
Anonymous
Not applicable

Show only the invoices that have more than one code

Hi community,

I am struggling with something that is probably pretty simple, I just cant make it work. My data looks like below in a matrix layout:

Capture1.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I want to show only the invoices that have more than one servicecode against them. So, the red crossed ones shouldn't appear in the matrix.

I tried grouping in a dax formula, but doesnt work. My sample pbi file is attached:

https://1drv.ms/u/s!Ag919_pO_UKrgQG4x8WBL51QJYz9?e=erDEu4

 

Many thanks in advance,

Meena

2 ACCEPTED SOLUTIONS
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a measure and add it to the visual level filter

Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Service code] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Servicedate]
            = MAX ( 'Table'[Servicedate] )
            && 'Table'[GP Code]
                = MAX ( 'Table'[GP Code] )
            && 'Table'[invoiceid]
                = MAX ( 'Table'[invoiceid] )
    )
)

Capture1.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
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

amitchandak
Super User
Super User

Check solution at

https://www.dropbox.com/s/rl1ks43ydzirtao/Test_invoices.pbix?dl=0

 

New amount = CALCULATE(SUM('Table'[Amount]),VALUES('Table'[Servicedate]),FILTER('Table',[Measure]>1))
Measure = CALCULATE(DISTINCTCOUNT('Table'[Service code]),ALLEXCEPT('Table','Table'[GP Code],'Table'[Servicedate]))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Check solution at

https://www.dropbox.com/s/rl1ks43ydzirtao/Test_invoices.pbix?dl=0

 

New amount = CALCULATE(SUM('Table'[Amount]),VALUES('Table'[Servicedate]),FILTER('Table',[Measure]>1))
Measure = CALCULATE(DISTINCTCOUNT('Table'[Service code]),ALLEXCEPT('Table','Table'[GP Code],'Table'[Servicedate]))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a measure and add it to the visual level filter

Measure =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Service code] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Servicedate]
            = MAX ( 'Table'[Servicedate] )
            && 'Table'[GP Code]
                = MAX ( 'Table'[GP Code] )
            && 'Table'[invoiceid]
                = MAX ( 'Table'[invoiceid] )
    )
)

Capture1.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors