The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
122 | |
89 | |
75 | |
55 | |
45 |
User | Count |
---|---|
134 | |
120 | |
76 | |
65 | |
64 |