Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I need some help with writing a measure to get the specific desired result.
Please find below the raw data along with the output that I am looking for.
Raw Data :
| Date | Name | Hours | Category |
| 1/3/2020 | Sam | 7.5 | Cat 1 |
| 1/2/2020 | Sam | 7.5 | Cat 1 |
| 1/4/2020 | Sam | 5 | Cat 1 |
| 1/4/2020 | Sam | 5 | Cat 2 |
| 1/4/2020 | Sam | 5 | Cat 3 |
| 1/4/2020 | Sam | 5 | Cat 4 |
| 1/4/2020 | Sam | 5 | Cat 5 |
| 1/4/2020 | Sam | 5 | Cat 6 |
| 1/2/2020 | Sam | 7.5 | Cat 3 |
| 1/2/2020 | Sam | 7.5 | Cat 7 |
| 1/3/2020 | Sam | 7.5 | Cat 8 |
| 1/3/2020 | Sam | 7.5 | Cat 9 |
| 1/3/2020 | Sam | 7.5 | Cat 10 |
| 1/3/2020 | Sam | 7.5 | Cat 6 |
| 1/2/2020 | Sam | 7.5 | Cat 6 |
| 1/3/2020 | Sam | 7.5 | Cat 11 |
| 1/3/2020 | Sam | 7.5 | Cat 3 |
| 1/2/2020 | Sam | 7.5 | Cat 2 |
| 1/3/2020 | Sam | 7.5 | Cat 2 |
Desired Output :
| Output | |
| Name | Total Hours |
| Sam | 20 |
| Cat 1 | 20 |
| Cat 2 | 20 |
| Cat 3 | 20 |
| Cat 4 | 20 |
| Cat 5 | 20 |
| Cat 6 | 20 |
| Cat 7 | 20 |
| Cat 8 | 20 |
| Cat 9 | 20 |
| Cat 10 | 20 |
| Cat 11 | 20 |
| Total | 20 |
Output I am getting (This is incorrect)
| Name | Total Hours |
| Sam | 20 |
| Cat 1 | 20 |
| Cat 2 | 20 |
| Cat 3 | 20 |
| Cat 4 | 5 |
| Cat 5 | 5 |
| Cat 6 | 20 |
| Cat 7 | 7.5 |
| Cat 8 | 7.5 |
| Cat 9 | 7.5 |
| Cat 10 | 7.5 |
| Cat 11 | 7.5 |
| Total | 20 |
The measure that I am looking for should calculate the total no. of hours based on the dates irrespective of task category.
Any help on this would be highly appreciated
Thank you
Pull below measure in your Visual:
SumOfHours=CALCULATE(SUM(Table[Hours]),ALL(Table[Category]))
Start by explaining the logic that gives, say, Cat 7 = 20. There's one line for Cat 7, and it says 7.5.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 33 | |
| 31 | |
| 29 |