The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a Fact Revenue, and I am trying to get the MAX of a group…
I want to group revenue by Customer and Sector… and then pick the MAX for each Customer…
(I can do this visually when I put in a Matrix, Customer, Sector and Revenue).
The below measures do the work for me
SubTotalCustomerSec =
CALCULATE ( SUM(FactRevenue[Revenue]), ALLEXCEPT ( FactRevenue, 'Customer'[Customer], 'Sector'[Sector] ) )
MaxSecerCustomer =
MAXX ( ALLEXCEPT ( FactRevenue, 'Customer'[Customer] ), [SubTotalCustomerSec] )
The problem is that I can’t filter… I want to achieve the above but still be able to select a specific Customer or pick a specific value for a higher level than customer…
If I select any specific Customer or ParentCustomer and add my above measures, the matrix brings all the rows for all ParentCustomers...
Solved! Go to Solution.
My bad on copying from your expressions incorrectly. I meant to write this.
Max Measure =
VAR summary =
ADDCOLUMNS (
SUMMARIZE ( FactRevenue, 'Customer'[Customer], Sector[Sector] ),
"cTotal", CALCULATE ( SUM ( FactRevenue[Revenue] ) )
)
RETURN
MAXX ( summary, [cTotal] )
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
My bad on copying from your expressions incorrectly. I meant to write this.
Max Measure =
VAR summary =
ADDCOLUMNS (
SUMMARIZE ( FactRevenue, 'Customer'[Customer], Sector[Sector] ),
"cTotal", CALCULATE ( SUM ( FactRevenue[Revenue] ) )
)
RETURN
MAXX ( summary, [cTotal] )
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You could try an approach like this.
Max Measure =
VAR summary =
ADDCOLUMNS (
SUMMARIZE ( FactRevenue, 'Customer'[Customer], [SubTotalCustomerSec] ),
"cTotal", CALCULATE ( SUM ( FactRevenue[Revenue] ) )
)
RETURN
MAXX ( summary, [cTotal] )
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@mahoneypat thanks for the ansewr but I can't write SUMMARIZE ( FactRevenue, 'Customer'[Customer], [SubTotalCustomerSec] ),
since SUMMARIZE doesn't accept the measure.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
97 | |
80 | |
62 | |
57 |
User | Count |
---|---|
264 | |
120 | |
115 | |
83 | |
70 |