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
EvertonRosa
Helper I
Helper I

Create Table based on columns and measures

Community, I need a little help!

 

Is there any way to create a table based on a column and a measure? Let me explain the case:

I have a PRODUCTS table with a column called family_name. Each product has its own family. Ex:

 

productfamily_name
1AAA
2AAB
3AAC
4AAD
5AAE

 

I have a measure that CALCULATE the Time to Win for each opportunitie on table OPPORTUNITIES. Ex: 

 

Time to Win (Family) =
CALCULATE(
    AVERAGEX(
        SUMMARIZE(
            FILTER(fOportunities,fOportunities[statecode] = 1),
            fOportunities[opportunityid],
            dProducts[family_name],
            "AvgDays",MAX(fOportunities[DaystoClose])
        ),
        [AvgDays]
    ),
    USERELATIONSHIP(dCalendar[ID Data],fOportunities[actualclosedate])
)

Now, I wloud like to generate a table like this: 
family_nameTime to Win
AAA5
AAB10
AAC15
AAD20
AAE25

 

I have tried to aproach using SUMMARIZE, ADDCOLUMN but I couldn´t figure out how to do it. Any help?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@EvertonRosa , if you create calculated table, the measure can not take slicer value and calculation may not go as planned and will be static

 

Add a new column, using addcolumns, and use related , relatedtable, or simple max function work across the table

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@EvertonRosa , if you create calculated table, the measure can not take slicer value and calculation may not go as planned and will be static

 

Add a new column, using addcolumns, and use related , relatedtable, or simple max function work across the table

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Thanks, @amitchandak. I found a solution after watch your videos. 

Create calculate column and use either Related or RelatedTable function.

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.

Top Solution Authors