Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hey all. I have a few questions. The first is: Is it good practice to create a measure on calculated columns when row by row aggregations are necessary?
My example is I have two dates I need to see the difference between. I need them broken up by hour groups, so less the 2 hours, 2-4 hours, 6-8, and greater than 8.
Exmpale DAX for calculated column in Table2:
6To8Hours = IF(DATEDIFF(RELATED(Table1[FromDate]),Table2[ToDate],HOUR) > 6 && DATEDIFF(RELATED(Table1[FromDate]),Table2[ToDate]],HOUR) <= 8, 1, 0)
I then create a measure in Table2:
SUM POS 6 to 8 = CALCULATE(SUM(Table2[6To8Hours]), Table2[6To8Hours] = 1)
I tried putting the whole thing in a measure to avoid the calc column but it couldn't find the related table - not sure of the reason for this.
My last question is that my end game is to create a slicer to use in a visual using these measures to change what hour group is being displayed. I am using the instructions found HERE which doesn't seem to get me the whole way as the slicer shows no data in the graph unless I select multiple slicer options - which it then shows the same static numbers no matter what I choose.
@Anonymous , you should be able to use related in a measure on the M side. In case you need bucket on meausre you need to try segmentation - refer: https://www.youtube.com/watch?v=CuczXPj0N-k
or
https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 14 |