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.
Hi Power BI Comunity, please help
I need to count values for column "Items_Category" in Power BI, if my source only gives me 2 columns- Category & Items?
Items_Category is the output in 3rd column/ measure derived by adding items based on Category, Eg: Electronics = 50+125+200 = 375, but it has to show for all Electronics related rows.
Should i add column or use measure- please suggest what, why and how- it would be great.
Category | Items | Items_Category |
Electronics | 50 | 375 |
Clothing | 75 | 450 |
Miscellaneous | 100 | 525 |
Electronics | 125 | 375 |
Clothing | 150 | 450 |
Miscellaneous | 175 | 525 |
Electronics | 200 | 375 |
Clothing | 225 | 450 |
Miscellaneous | 250 | 525 |
Solved! Go to Solution.
Hello @Gguliani ,
Try creating a column like the following:
CountCalc ? CALCULATE(SUM(tablename[Items]), FILTER(tablename, tablename[Category] ? EARLIER(tablename[Category] )))
Thank you
Pragati
Hello @Gguliani ,
Try creating a column like the following:
CountCalc ? CALCULATE(SUM(tablename[Items]), FILTER(tablename, tablename[Category] ? EARLIER(tablename[Category] )))
Thank you
Pragati
Getting an error @Pragati11 , field names and table names are different than dummy values asked in the query
Hi @Anonymous ,
You forgot to close a bracket after SUM function in your DAX. Check my dax expression again.
Thanks,
Pragati
Hi @Anonymous ,
Your question is not very clear. Can you describe more on what's your current input is and what output is required?
Thanks,
Pragati
Sorry, i realised that too and updated it, please check
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 |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |