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.
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())
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 |
---|---|
96 | |
95 | |
80 | |
74 | |
66 |
User | Count |
---|---|
130 | |
106 | |
105 | |
86 | |
72 |