The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, I'm new to PowerBI, I was wondering what the best way to count values in a group then use the count in a calculation, I have a query like this:
0 1 2 3
a . . T
a . . T
a . . F
b . . T
b . . null
b . . F
b . . F
I understand that if you create a Table from this query, it will group by a and b and you can create counts of T or F, where T and F are strings with null values, within the table, but would you use the counts in a dependent calcuation? So that the table looked like:
0 1 2 TF_calc
a . . T_count^2/F_count^2
b . . T_count^2/F_count^2
Thanks in advance!
Solved! Go to Solution.
Hi @hanr ,
Based on my test, you could refer to below formula:
Test = SUMMARIZE('Table1','Table1'[0],"A", (CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="T"))*CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="T"))) /(CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="F"))*CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="F"))))
Result:
You could also downlad the pbix file to have a view.
Regards,
Daniel He
Hi @hanr ,
Based on my test, you could refer to below formula:
Test = SUMMARIZE('Table1','Table1'[0],"A", (CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="T"))*CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="T"))) /(CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="F"))*CALCULATE(COUNT(Table1[3]),FILTER('Table1','Table1'[3]="F"))))
Result:
You could also downlad the pbix file to have a view.
Regards,
Daniel He
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
79 | |
71 | |
48 | |
41 |
User | Count |
---|---|
138 | |
108 | |
71 | |
64 | |
58 |