Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
This measure makes it so I am able to select more than one month on my report.
When no months are selected, however, it returns this.
Is it possible to make the card display "All Months?"
I would greatly appreciate any advice.
Solved! Go to Solution.
@Anonymous wrote:This measure makes it so I am able to select more than one month on my report.
When no months are selected, however, it returns this.
Is it possible to make the card display "All Months?"
I would greatly appreciate any advice.
Well, first of all, you should not use the automatically generated table of dates in Power BI (you should disable this option). Please do yourself a favour and create a proper date table and connect it to your fact table. If you want to have problems down the line and not know how to deal with them, you can use the automatic table but don't say I have not warned you!
Once you have the date table in the model connected to your fact table, you can do this:
[Months Visible] = var __numberOfVisibleMonths = DISTINCTCOUNT( Dates[MonthShortName] ) var __allMonthsSelected = __numberOfVisibleMonths = 12 var __monthsVisible = CONCATENATEX( SUMMARIZE( Dates, Dates[MonthShortName], Dates[MonthNumberInTheYear] ), Dates[MonthShortName], ", ", Dates[MonthNumberInTheYear] ) return if( __allMonthsSelected, "All Months", __monthsVisible )
Your model does not look to be correctly structured. Please learn a bit about the correct design and the star schema. You'll save yourself grief and scratching your head.
Best
Darek
@Anonymous wrote:This measure makes it so I am able to select more than one month on my report.
When no months are selected, however, it returns this.
Is it possible to make the card display "All Months?"
I would greatly appreciate any advice.
Well, first of all, you should not use the automatically generated table of dates in Power BI (you should disable this option). Please do yourself a favour and create a proper date table and connect it to your fact table. If you want to have problems down the line and not know how to deal with them, you can use the automatic table but don't say I have not warned you!
Once you have the date table in the model connected to your fact table, you can do this:
[Months Visible] = var __numberOfVisibleMonths = DISTINCTCOUNT( Dates[MonthShortName] ) var __allMonthsSelected = __numberOfVisibleMonths = 12 var __monthsVisible = CONCATENATEX( SUMMARIZE( Dates, Dates[MonthShortName], Dates[MonthNumberInTheYear] ), Dates[MonthShortName], ", ", Dates[MonthNumberInTheYear] ) return if( __allMonthsSelected, "All Months", __monthsVisible )
Your model does not look to be correctly structured. Please learn a bit about the correct design and the star schema. You'll save yourself grief and scratching your head.
Best
Darek
Thank you for the advice! I have read a bit about the star schema- I am not sure if it would work with the data I am using. It was pulled from a company ERP system and the data is essentially stacked on top of one another. I performed joins in SQL Server and transferred the file to Power BI as a single table, per my supervisor's request.
Whoever your supervisor is... he's got little idea about proper dimensional design 🙂
You want to know better? Go to www.sqlbi.com and read all you can read in there... Find the right articles on proper design within Power BI. Tell your supervisor as well to do the same since he has no idea what he says to you and what problems you'll have down the line with a single table design.
Best
Darek
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |