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 Guys,
I am trying to get a measure (of calculated collumn) in my Power BI that returns a SUM of a specific value.
To be more specific;
The table i have is;
Empl | Month | Value | Year
A 1 0 2016
A 1 0 2016
A 1 1 2016
A 1 0 2016
A 2 1 2016
A 2 0 2016
A 3 0 2016
B 1 1 2016
B 2 0 2016
B 2 1 2016
B 2 0 2016
B 2 0 2016
I would like to calculate each Year/Month per Employee the Value, when The rows for the specific Year/Month/Employee is Containing at least one row with zero (0) then the result of the measure should be 0, else the result should be 1.
In other words; the above table should result in
Empl | Month | Measure Result | Year
A 1 0 2016
A 2 0 2016
A 3 1 2016 <<The rows of same year, Month, Employee is only containing the value 1 and no other rows with the value 0
B 1 1 2016<<The rows of this year, Month, Employee is only containing the value 1 and no other rows with the value 0
B 2 0 2016
Last but not least i would like to SUM the results Per year and Month on all employees.
I realy hope someone could help me out on this matter, i would realy appreciate it!
Solved! Go to Solution.
In this scenario, you can create two measures with following formulas to get the results.
Measure Result = IF ( SUM ( Table1[Value] ) < COUNTROWS ( Table1 ), 0, 1 )
Measure Total = SUMX ( SUMMARIZE ( Table1, Table1[Empl], Table1[Month], Table1[Year], "Measure Result", [Measure Result] ), [Measure Result] )
Best Regards,
Herbert
In this scenario, you can create two measures with following formulas to get the results.
Measure Result = IF ( SUM ( Table1[Value] ) < COUNTROWS ( Table1 ), 0, 1 )
Measure Total = SUMX ( SUMMARIZE ( Table1, Table1[Empl], Table1[Month], Table1[Year], "Measure Result", [Measure Result] ), [Measure Result] )
Best Regards,
Herbert
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 |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |