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 have below sample data table that i'd like to import to powerbi. When i import i'd like to format, "Gross","Net","Volume" as a whole number, "GP %" and "Contribution" as percentage.
Can anyone have a solve for this problem?
Gross | 2000 |
Net | 3000 |
Volume | 1500 |
GP % | 20% |
Contribution | 15% |
Solved! Go to Solution.
@dokat One method would be to use a Calculation Group. Another method would be to use FORMAT. Still another method would be to pivot your first column in Power Query using your second column as the value and then you can set the data types correctly for each column (preferred).
Measure =
SWITCH(MAX([Attribute]),
"GP %",FORMAT(MAX([Value]),"Percent"),
"Contribution",FORMAT(MAX([Value]),"Percent")
[Value] & ""
)
@dokat One method would be to use a Calculation Group. Another method would be to use FORMAT. Still another method would be to pivot your first column in Power Query using your second column as the value and then you can set the data types correctly for each column (preferred).
Measure =
SWITCH(MAX([Attribute]),
"GP %",FORMAT(MAX([Value]),"Percent"),
"Contribution",FORMAT(MAX([Value]),"Percent")
[Value] & ""
)