Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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!
Solved! Go to Solution.
Hi @Yian ,
According to your description, here's my solution.
1.Create relationship between Client Owershhip Breakdown and Item Expense Breakdown.
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:
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.
Hi @Yian ,
According to your description, here's my solution.
1.Create relationship between Client Owershhip Breakdown and Item Expense Breakdown.
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:
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.
For support with Tableau Level of Detail expressions,
have you considered exploring support from the Tableau Community
Support Forums?
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.
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:
Dairy | Grocery | Total | |
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
User | Count |
---|---|
93 | |
84 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |