The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
HI I want this table
Date | Account | Value | Type |
2023-10-05 | 2 | X | a |
2023-10-05 | 2 | Y | a |
2023-10-05 | 2 | Z | b |
2023-10-05 | 2 | F | b |
To result when inserted into a matrix
Date | Account | Value (Measure) |
2023-10-05 | 2 | X + Y |
2023-10-05 | 2 | Z |
2023-10-05 | 2 | F |
So a measure that aggregates Value if type is a but not if type is b, the ALL rows shapp be shown for a specific date and account.
Hi,
I am not sure if I understood your question correctly, but I tried to solve this by adding index column into the table like below.
Please check the below picture and the attached pbix file if it suits your requirement.
Expected result measure: =
VAR _minindex =
MINX (
FILTER ( ALL ( Data ), Data[Type] = MAX ( Data[Type] ) ),
CALCULATE ( SELECTEDVALUE ( Data[Index] ) )
)
RETURN
IF (
MAX ( Data[Type] ) = "a",
IF (
MAX ( Data[Index] ) = _minindex,
CALCULATE ( SUM ( Data[Value] ), FILTER ( ALL ( Data ), Data[Type] = "a" ) ),
BLANK ()
),
SUM ( Data[Value] )
)
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |