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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AlwaysBI
Frequent Visitor

AllExcept and filter

HI

 

I need some help.

I have a table below.

YearMonthDayProductTypeGroupPrice
201931AOwnFirst Group A100
201931BCompetitorFirst Group A120
201931COwnFirst Group B90
201931DCompetitorFirst Group B80
201935EOwnFirst Group C150
201935FCompetitorFirst Group C170
201937GOwnFirst Group D150
201937HCompetitorFirst Group D120

 

and I would like to show the competitor price in every group itself.

Below is the measure I use and the expected result that I want to archive. Please advise.

 

CompetitorPricebyGroup =
CALCULATE(AVERAGE('Table'[price]),FILTER(ALLEXCEPT('Table','Table'[Day],'Table'[Month],'Table'[Group]),'Table'[Type]= "Competitor"),ALL('Table'))
 
Expected Result
YearMonthDayProductTypeGroupPriceCompetitor Price
201931AOwnFirst Group A100120
201931BCompetitorFirst Group A120120
201931COwnFirst Group B9080
201931DCompetitorFirst Group B8080
201935EOwnFirst Group C150170
201935FCompetitorFirst Group C170170
201937GOwnFirst Group D150120
201937HCompetitorFirst Group D120120

 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @AlwaysBI 

You can create a calculated colum in the table you show (Table1):

 

Competitor Price =
CALCULATE (
    DISTINCT ( Table1[Price] );
    ALLEXCEPT ( Table1; Table1[Group] );
    Table1[Type] = "Competitor"
)

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @AlwaysBI 

You can create a calculated colum in the table you show (Table1):

 

Competitor Price =
CALCULATE (
    DISTINCT ( Table1[Price] );
    ALLEXCEPT ( Table1; Table1[Group] );
    Table1[Type] = "Competitor"
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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