Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
With the 'Time' category sorted from earliest to latest in my Table visualisation, I would like to find a way to subtract the corresponding times between the first Event Type ID = 13 and the last Event Type ID = 14. I would like to do this for both the Am and the Pm session. The times highlighted in yellow refer to the AM's session first 13 and last 14. The times corresponding to the blue circles refer to the PM's session first 13 and last 14.
Solved! Go to Solution.
Hi @newtralise ,
Please try this expression to do that:
Measure =
VAR _a =
FILTER ( ALL ( 'Table (2)' ), [Time] < TIME ( 12, 0, 0 ) )
VAR _p =
FILTER ( ALL ( 'Table (2)' ), [Time] >= TIME ( 12, 0, 0 ) )
RETURN
IF (
MAX ( 'Table (2)'[Time] ) < TIME ( 12, 0, 0 ),
CALCULATE ( MAX ( 'Table (2)'[Time] ) - MIN ( 'Table (2)'[Time] ), _a ),
CALCULATE ( MAX ( 'Table (2)'[Time] ) - MIN ( 'Table (2)'[Time] ), _p )
)
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @newtralise ,
Please try this expression to do that:
Measure =
VAR _a =
FILTER ( ALL ( 'Table (2)' ), [Time] < TIME ( 12, 0, 0 ) )
VAR _p =
FILTER ( ALL ( 'Table (2)' ), [Time] >= TIME ( 12, 0, 0 ) )
RETURN
IF (
MAX ( 'Table (2)'[Time] ) < TIME ( 12, 0, 0 ),
CALCULATE ( MAX ( 'Table (2)'[Time] ) - MIN ( 'Table (2)'[Time] ), _a ),
CALCULATE ( MAX ( 'Table (2)'[Time] ) - MIN ( 'Table (2)'[Time] ), _p )
)
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
76 | |
63 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
64 | |
59 | |
56 |