Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello All
I am trying to create a division calculation on top a numeric column derived using a switch statement.
Codeval = SWITCH('Table'[Index], "1", 1, "2", 1, "3",1, "4",1, 0).
"Index" column is nested index created and defined as text for avoiding auto aggregation of the index numbers in previous calculations.
Expecting results like "AvgSalesby4" column in the below screen shot. AVGsale formula performs SumofSale/1 instead of Sumsale/4, please let me know what is the issue. Tried summarize function by creating a table was not helpful.
Thanks
Kavitha
Solved! Go to Solution.
Hi Guavaq,
I tried this following by creating it as a measure as per your ealier suggestion
NewMeasure = Divide(sum(Sumofsales), count(Codeval),0) worked..!
Thank you..!
Hi guavaq,
Thanks for the reply, i am assuming its aggregate attribute. i am new to Power BI but have worked on various other BI technologies. based on its properties i see default summarization as "sum" and icon symbol is same of that of the other numeric metrics like SumSales.
If i tried to use SUM() on Codeval = Sum(SWITCH('Table'[Index], "1", 1, "2", 1, "3",1, "4",1, 0)), i get this error - The SUM function only accepts a column reference as an argument.
Thanks
Kavitha
Hi Guavaq,
I tried this following by creating it as a measure as per your ealier suggestion
NewMeasure = Divide(sum(Sumofsales), count(Codeval),0) worked..!
Thank you..!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |