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.
Hello World,
Could you help me?
I'm new in power BI and I didn't find the answer for my question on the internet
I Need to calculate a quantity of months have in my sheet.
For example, in 2019 I have five months (Aug, Sep, Oct, Nov and Dec), and in 2020 I have more five months (Jan, Feb, Mar, Apr, May) = Total of 10 months. When i make "distinctcount(Months)" the system count 12 months, but don't have Jun and Jul in my sheet.I want to know why that happens.
And in Aug of 2020, I don't know how count one new month.
Could you help with me these two questions?
Thankful
Hi @Anonymous ,
You could try this firstly:
Count Months = CALCULATE(DISTINCTCOUNT('Table'[Month]),ALLEXCEPT('Table','Table'[Year]))
Firsting, tnks so much for your help
unfortunately this formula keeps returning me 12 months, not 10
If you want to take a look at my database, the link is below
https://drive.google.com/drive/folders/1G1vJfbr-Nd-ZrkTm736q3Vy8G2oJeu9U?usp=sharing
@Anonymous
maybe you can try add a month column
month=month(table[date])
Then distinctcount(month)
Proud to be a Super User!
@Anonymous
Please share the sample data and the expected output.
Proud to be a Super User!
Hi Ryan,
Follow Bellow link of the sheet
https://drive.google.com/drive/folders/1G1vJfbr-Nd-ZrkTm736q3Vy8G2oJeu9U?usp=sharing
I need that the count of the months returns 10
the way I'm doing it is returning 12, and in my database there are no months June and July
so far I am using the same formula as in the comment below:
I don't have a DCalendar sheet, so it doesn't make sense to make a formula using another sheet
Tnks for your Help
You could add a calculated column to your table with this formula
YearMonth = FORMAT(Table[Date], "YYYMMM")
and then make a measure that does a DISTINCTCOUNT of that column.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi,
I believe you are applying distinct count on the column which have 10 months instead of calendar table (if you have any).
Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂
Regards,
N V Durga Prasad
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 |
---|---|
112 | |
97 | |
85 | |
68 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |