Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi Community
After some help to create a measure to get data always at the current reporting month. The count I need is based in one table and date is from a mapping table. I have tried MTD, quick measure and other code provided by the community but does not seem to be working.
Essentially, the measure is to be used to calculate other data that uses a slicer reporting date field. Any help is greatly appreciated ! 🙂
Solved! Go to Solution.
Hi @Sara16 ,
Please try code as below to create a measure.
Monthly Count =
VAR _RANGESTART =
EOMONTH ( TODAY (), -1 )
VAR _RANGEEND =
EOMONTH ( TODAY (), 0 )
VAR _Count =
CALCULATE (
COUNT ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Date] > _RANGESTART && 'Table'[Date] <= _RANGEEND )
)
RETURN
_Count
My Sample:
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks! It worked 🙂
Hi @Sara16 ,
Please try code as below to create a measure.
Monthly Count =
VAR _RANGESTART =
EOMONTH ( TODAY (), -1 )
VAR _RANGEEND =
EOMONTH ( TODAY (), 0 )
VAR _Count =
CALCULATE (
COUNT ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Date] > _RANGESTART && 'Table'[Date] <= _RANGEEND )
)
RETURN
_Count
My Sample:
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
157 | |
120 | |
74 | |
72 | |
63 |