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.
Hello everyone
I would like to know if in power BI there is any function or how I should do so that of these 3 columns I only leave the first one with the values of the other 2
I need the values in row 2 and 3 to stay in row 1
THANKS¡¡¡
Solved! Go to Solution.
Try a calculated table:
ADDCOLUMNS (
SUMMARIZE (
TableName[NUM ID],
TableName[Type]
),
"Col1", CALCULATE ( SUM ( TableName[1] ) ),
"Col2", CALCULATE ( SUM ( TableName[2] )),
"Col1+2", CALCULATE ( SUM ( TableName[1+2] ))
)
Alternatively you could use group by in power query.
Hi,
Show clearly the result you are expecting. Share data in a format that can be pasted in an MS Excel file.
Hi @PVVBl00
first you to have a unique date or index column. If don't you need to create an index column using power query. Then for the 3rd column the code would be
1 + 2 =
VAR CurrentIndex = Date[Index]
VAR CurrentTable =
CALCULATETABLE ( Data, ALLEXCEPT ( Date, Data[NUM ID], Data[TYPE] ) )
VAR FirstIndex =
MINX ( CurrentTable, Data[Index] )
VAR TotalValue =
SUMX ( CurrentTable, Data[1] + Data[2] )
RETURN
IF ( CurrentIndex = FirstIndex, TotalValue, 0 )
Try a calculated table:
ADDCOLUMNS (
SUMMARIZE (
TableName[NUM ID],
TableName[Type]
),
"Col1", CALCULATE ( SUM ( TableName[1] ) ),
"Col2", CALCULATE ( SUM ( TableName[2] )),
"Col1+2", CALCULATE ( SUM ( TableName[1+2] ))
)
Alternatively you could use group by in power query.
Everything works perfectly for me, thank you very much :)), but in the column of 1 + 2, the value of the sum brings me wrong, you have any idea why it should be?
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
71 | |
48 | |
46 |