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.
Hi,
So here I am elaborating my issue with one example.
My requirement is to add all the billing amount in between 01/01/2019 4:00 am to 02/01/2019 4:00 am using DAX.
The result should be $158 .
[Total Billing] =
var __start = DT1 -- DT1 and DT2 are dates taken from somewhere, possibly a slicer
var __end = DT2
var __result =
calculate(
sum( T[Billing] ),
T[Transaction Date] >= DT1,
T[Transaction Date] <= DT2,
ALL( T[Transaction Date] )
)
return
__result
I'll tell you right away: your model is sub-optimal. If the table you've shown is the fact table and you don't have any dimensions in a one:many relationship with the table, especially Date table and Time table, then you'll very soon be faced with DAX that will not be fast and no amount of fiddling with it will make it so. I'd really suggest you learn about the proper model design before you start building the whole thing WRONGLY. If after having built 80% of the model you'll find that you've done it incorrectly, think about the amount of work that will go into starting almost all over again...
You've been warned.
Best
Darek
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 |
---|---|
39 | |
19 | |
17 | |
16 | |
16 |
User | Count |
---|---|
50 | |
24 | |
21 | |
17 | |
16 |