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 Team, can someone tell me how to get below one.
with below code, I'm getting all the days.
Solved! Go to Solution.
Hi, @Krishna090 ;
You could try it.
Days in month =
IF (
EOMONTH ( [First date of month], 0 ) <> EOMONTH ( TODAY (), 0 ),
DATEDIFF (
[First date of month],
R_AMHS_HLY_UPTIME_DET_VW[Last date of month],
DAY
) + 1,
DATEDIFF ( [First date of month], TODAY (), DAY ) + 1
)
If not right, can you share your simple data and the result what you want to output?
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Krishna090 ;
You could try it.
Days in month =
IF (
EOMONTH ( [First date of month], 0 ) <> EOMONTH ( TODAY (), 0 ),
DATEDIFF (
[First date of month],
R_AMHS_HLY_UPTIME_DET_VW[Last date of month],
DAY
) + 1,
DATEDIFF ( [First date of month], TODAY (), DAY ) + 1
)
If not right, can you share your simple data and the result what you want to output?
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-yalanwu-msft thanks for the quick reply and similarly I tried day before yesterday but mine is manual way. Where need to update the query based on the month no.
And below is the query I tried.
Hi,
Assuming there is a date column i your dataset, you should create a Calendar Table. Create a relationship (Many to One and Single) from the Date column of your dataset to the Date column of the Calendar Table. In the Calendar Table, write calculated column formulas to extract Year, Month name and Month number. Sort the Month name by the Month number. To your matrix visual, drag Year and Month name to the column section. Write this measure
Days in month = countrows(Calendar)
Hope this helps.
Assuming your visual shows months:
CALCULATE(COUNTROWS('Dates'),'Dates'[Date]<=TODAY())
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 June 2024 Power BI update to learn about new features.
User | Count |
---|---|
141 | |
109 | |
108 | |
76 | |
63 |
User | Count |
---|---|
273 | |
129 | |
123 | |
101 | |
91 |