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 August 31st. Request your voucher.
Currently, I have an input like below with hundreds of extra columns:
Country | ID | Initiative | Cost | mar-21 | apr-21 |
UK | 1 | 1 | 100 | 30 | 40 |
US | 2 | 2 | 150 | 12 | 11 |
IT | 3 | 2 | 20 | 14 | 11 |
How can I, without hard coding the current month (mar-21), identify the total per column which would be for UK = 30 and next month = 40? I need to create a new variable for current month.
Solved! Go to Solution.
That is a rather unfortunate table design. Have you considered unpivoting your month columns?
Unpivoting does the trick. Thank you!
That is a rather unfortunate table design. Have you considered unpivoting your month columns?
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |