Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JIGAR
Resolver IV
Resolver IV

Help Writing a Measure

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 : 

 

DateNameHoursCategory
1/3/2020Sam7.5Cat 1
1/2/2020Sam7.5Cat 1
1/4/2020Sam5Cat 1
1/4/2020Sam5Cat 2
1/4/2020Sam5Cat 3
1/4/2020Sam5Cat 4
1/4/2020Sam5Cat 5
1/4/2020Sam5Cat 6
1/2/2020Sam7.5Cat 3
1/2/2020Sam7.5Cat 7
1/3/2020Sam7.5Cat 8
1/3/2020Sam7.5Cat 9
1/3/2020Sam7.5Cat 10
1/3/2020Sam7.5Cat 6
1/2/2020Sam7.5Cat 6
1/3/2020Sam7.5Cat 11
1/3/2020Sam7.5Cat 3
1/2/2020Sam7.5Cat 2
1/3/2020Sam7.5Cat 2

 

 

Desired Output :

 

Output 
  
NameTotal Hours
Sam20
Cat 120
Cat 220
Cat 320
Cat 420
Cat 520
Cat 620
Cat 720
Cat 820
Cat 920
Cat 1020
Cat 1120
Total 20

 

Output I am getting (This is incorrect)

 

NameTotal Hours
Sam20
Cat 120
Cat 220
Cat 320
Cat 45
Cat 55
Cat 620
Cat 77.5
Cat 87.5
Cat 97.5
Cat 107.5
Cat 117.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

2 REPLIES 2
Anonymous
Not applicable

 

Pull below measure in your Visual:

 

 

SumOfHours=CALCULATE(SUM(Table[Hours]),ALL(Table[Category]))

 

 

 

jthomson
Solution Sage
Solution Sage

Start by explaining the logic that gives, say, Cat 7 = 20. There's one line for Cat 7, and it says 7.5.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.