Forum Discussion
nok
Advocate II
10 months agoCreate a table with unique IDs and calculations based on the original table
Hi! I have a table that follows this structure: ID Balance Type Date 111 10 A 20/10/2025 111 20 M 30/10/2025 222 5 A 02/12/2025 222 3 B 01/09/2024 333 4...
- 10 months ago
Hey,
try to make a calculated table with this dax
SummaryByID := ADDCOLUMNS( SUMMARIZE( 'Fact', 'Fact'[ID], "Balance", CALCULATE(SUM('Fact'[Balance])) ), // Type A "Count (Type A)", CALCULATE(COUNTROWS('Fact'), 'Fact'[Type] = "A"), "Max Date (Type A)", CALCULATE(MAX('Fact'[Date]), 'Fact'[Type] = "A"), // Type B "Count (Type B)", CALCULATE(COUNTROWS('Fact'), 'Fact'[Type] = "B"), "Max Date (Type B)", CALCULATE(MAX('Fact'[Date]), 'Fact'[Type] = "B"), // Type M "Count (Type M)", CALCULATE(COUNTROWS('Fact'), 'Fact'[Type] = "M"), "Max Date (Type M)", CALCULATE(MAX('Fact'[Date]), 'Fact'[Type] = "M") )
Ashish_Mathur
Super User
10 months agoHi,
If you are OK with a measure based solution, then write these measures
Total = sum(Data[Balance])
C = calculate(countrows(Data),data[type]="A")
D = max(Data[Date])
Hope this helps.