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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I am struggling to find the various Time based measures in this table where column values are unpivoted. I want to calculate various measures as mentioned.
Hi @Tanzeel,
It sounds like a common date range analysis requirement, I'd like to suggest you take a look at the following link 'start date', 'end date' part if they suitable for your scenario:
Regards,
Xiaoxin Sheng
@Tanzeel If you're wanting these in the report output then you can work simply on measures, since you want them displayed in the the visuals.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@AllisonKennedy Thank you. Should I use Variables for complete logic or work on simply on measures?
@Tanzeel My suggestion would be to leave the columns unpivoted and use Filter DAX functions to create the measures you need. So for example,
Count Attempts to Join = SUMX(FILTER('Live Attendance', 'Live Attendance'[User Action] = "Joined"), 'Live Attendance'[Presence])
Then put that in a visual with StudentID in Rows or Axis.
You can use similar structure for many of the other measures, or you can use CALCULATE function if you prefer.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thanks... I think Measure is somehow good option. I have built the model as in snapsot-1 and tried to develop the graph as snapshot-2. Should I work on unpivoted columns based table or should make it pivoted to get separate columns?
Here's the preference for calculations: Do them as far upstream as possible, but not farther. This means that Power Query is better than a calculated column which in turn is better than a measure.
In your scenario you have atomic entities - students, days, courses. For each of your questions listed above you want to check if the answer to these questions can be influenced by any report filters. If the answer is no then a calculated column is perfectly good enough (if you don't like Power Query). If the answer is yes then you _really_ need a measure.
Use a calendar table in your data model, and add a column to your fact table that adds a date representation of your timestamp data. That will help you when you then use the standard date computation functions in DAX.