Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi there, I am trying to count periods in which a specific condition is active but the count restarts if the data changes in the time sequence
Example of data and expected data:
I am hoping to avoid the new OFFSET function as it seems it is not available in Analysis Services on Visual Studio which is what I need to deploy to.
Solved! Go to Solution.
hI @JAJ09 ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Create a measure.
MEASURE =
VAR _date =
CALCULATE (
MAX ( 'Table'[period] ),
FILTER (
ALL ('Table' ),
'Table'[Type] <> "V"
&& 'Table'[period] <= SELECTEDVALUE('Table'[period])
))
VAR _times =
CALCULATE (
COUNTROWS ('Table'),
FILTER (
ALL ( 'Table' ),
'Table'[period] <= SELECTEDVALUE('Table'[period])
&&'Table'[period] > _date
)
) + 0
RETURN
_times
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hI @JAJ09 ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Create a measure.
MEASURE =
VAR _date =
CALCULATE (
MAX ( 'Table'[period] ),
FILTER (
ALL ('Table' ),
'Table'[Type] <> "V"
&& 'Table'[period] <= SELECTEDVALUE('Table'[period])
))
VAR _times =
CALCULATE (
COUNTROWS ('Table'),
FILTER (
ALL ( 'Table' ),
'Table'[period] <= SELECTEDVALUE('Table'[period])
&&'Table'[period] > _date
)
) + 0
RETURN
_times
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
93 | |
83 | |
77 | |
71 | |
65 |
User | Count |
---|---|
114 | |
101 | |
96 | |
65 | |
60 |