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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
tomshaw83
Helper I
Helper I

DAC simple measure help - conditional count

Hi there,

 

I am after some help with a dax measure, I have 2 tables similar to the below that I am importing into the front end:-

 

Employee Table

NameMethod of TravelTime to Work
John DoeCar04:01:56
Simon ShreevesCycle01:01:56
Lucy JonesWalk00:30:24
Paul SmithWalk00:43:21
Carl MorganCar01:23:34

 

Method Average Table

Method of TravelAverage+1%+2%+3%
Car01:00:0001:06:0001:12:0001:18:00
Walk00:30:0000:33:0000:36:0000:39:00
Cycle00:40:0000:44:0000:48:0000:52:00

 

I am after a table in the front end that looks like the below, the count is based on a dynamic measure so I can use a slicer for (Average, 1%, 2%, 3%) and it recalculates accordingly. Effectively if Time to work <= (average, 1%, 2%, 3%) then count

 

Method of TravelCount
Car1
Walk1
Cycle0

 

Any help on this would be greatly appreciated


Thanks


Tom

2 REPLIES 2
Anonymous
Not applicable

Instead of working with times, it's much easier to work with integers. Just convert the times into the total number of minutes (since you're not interested in seconds, as much as I cas see). Secondly, the second table of yours is pivoted. Unpivot it and make the columns' names (Average + 1%, +2%,...) an attribute's value and the time (integer) another attribute's value. This is how it should be done according to the philosophy of PBI. Once you have this design, it'll be dead easy to write measure(s) you're after.

tomshaw83
Helper I
Helper I

Ok, thank you, based on the assumptions above, could you give an idea what the DAX code would look like for the Travel count measure - i'm used to working with IF statements in excel, but don't know where to start in DAX

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)