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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Yian
Frequent Visitor

LOD on existing measure

Hi community,

 

I have a measure created and now I want to groupby this measure based on another column. I am new to Power BI and not sure how to do this. Appreciate any help provided!

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Yian ,

According to your description, here's my solution.

1.Create relationship between Client Owershhip Breakdown and Item Expense Breakdown.

vyanjiangmsft_0-1691724309509.png

2.Create a measure:

Measure =
VAR _T =
    ADDCOLUMNS (
        'Item Expense Breakdown',
        "Owership",
            MAXX (
                FILTER (
                    'Client Ownership Breakdown',
                    'Client Ownership Breakdown'[Item number]
                        = EARLIER ( 'Item Expense Breakdown'[Item Name] )
                        && RELATED ( 'Item Include/Exclude'[Include/Exclude] ) = "Include"
                ),
                'Client Ownership Breakdown'[Client Ownership]
            )
    )
VAR _ex =
    SUMX ( _T, [Owership] * [Expense] )
RETURN
    IF (
        ISINSCOPE ( 'Client Ownership Breakdown'[Client] ),
        _ex,
        SUMX ( ALL ( 'Client Ownership Breakdown' ), _ex )
    )

Get the correct result:

vyanjiangmsft_1-1691724432614.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Yian ,

According to your description, here's my solution.

1.Create relationship between Client Owershhip Breakdown and Item Expense Breakdown.

vyanjiangmsft_0-1691724309509.png

2.Create a measure:

Measure =
VAR _T =
    ADDCOLUMNS (
        'Item Expense Breakdown',
        "Owership",
            MAXX (
                FILTER (
                    'Client Ownership Breakdown',
                    'Client Ownership Breakdown'[Item number]
                        = EARLIER ( 'Item Expense Breakdown'[Item Name] )
                        && RELATED ( 'Item Include/Exclude'[Include/Exclude] ) = "Include"
                ),
                'Client Ownership Breakdown'[Client Ownership]
            )
    )
VAR _ex =
    SUMX ( _T, [Owership] * [Expense] )
RETURN
    IF (
        ISINSCOPE ( 'Client Ownership Breakdown'[Client] ),
        _ex,
        SUMX ( ALL ( 'Client Ownership Breakdown' ), _ex )
    )

Get the correct result:

vyanjiangmsft_1-1691724432614.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

pbiblog
Advocate II
Advocate II

For support with Tableau Level of Detail expressions,

have you considered exploring support from the Tableau Community

Support Forums? 

 

 

ToddChitt
Super User
Super User

This statement does not make sense: "group by this measure based on another column"

 

You cannot GROUP BY a Measure. Perhaps if you gave us an example of your data as it is now, and then an example of what you want to visualize.

Basically, we need more information.

 




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Hello,

 

I have attached a sample .pbix file below for your reference. Essentially, the 'Item Expense Breakdown' table serves as the master table connecting to all other tables. This table comprises various expenses incurred for each item. Some items have only one expense (a single row of data), while others have multiple expenses (multiple rows of data for one item). Each expense has a corresponding account number. The 'Item Include/Exclude' table and 'Fee Category' table provide information on which items to include in the analysis and the fee category for each account number. Lastly, the 'Client Ownership Breakdown' table displays the percentage share of each client's expenses for each item. A value of 1 represents 100%, and 0.04 signifies 4%. Some items have only one client, while others have more than one.

 

I would like to create a matrix table that displays each client's expenses for dairy and grocery fee categories, specifically for the included items. Below is a screenshot that demonstrates the desired appearance of the visualization:

 DairyGroceryTotal
Mary   
Lily   
John   
Henry   
Jessica   
Zoey   
Aberlene   
Joanna   
Maggie   
Total   

 

Please let me know if you can view the sample file below. Thanks very much!

https://drive.google.com/file/d/1TsjGWdLJ9F8ZDx9n2bZmzTlXroCZ19VA/view?usp=sharing

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.