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.
I have a report where I am changing the various views of the data by using a timeslicer. The dataset is a table of meeting information - starttime, endtime etc. from which I calculate utilization, length etc. If I have a meeting that lasts 12 hours each day, when I calculate utilization of the room (as a percentage over a 12 hour period) it should always be 100%. Hwoever, when the the timeslicer selects 2 or more days, the utilization is multiplied by the number of days - so 2 days where the meeting lasted 12 hours would report as 200% usage whereas what I want is it to report 100% usage over those 2 days. To do this, I need to get a variable which holds the number of days in the period selected by the timeslicer so I can divide the utilization % by the number of days. How do I do this? i.e. how to programiatically (in DAX) get the daterange selected by the time slicer?
This data is pulled from SQL and the report is setup as an import report.
Solved! Go to Solution.
You may refer to DAX below.
Measure = COUNTROWS ( ALLSELECTED ( 'Table'[Date] ) )
You may refer to DAX below.
Measure = COUNTROWS ( ALLSELECTED ( 'Table'[Date] ) )
Hi @banthorpe
MAX('Date' [FullDate]) - MIN( 'Date' [FullDate]) +1
should do it. Where 'Date' [FullDate] is the base column with the date in your 'Date' table.
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |