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 Guys,
I'm using a calendar table in my data model and have a measure that shows zero when there are blanks. The reason I'm doing this is that I want to show a complete time series even if the customer doesn't make purchases in a particular month. The problem I'm having is because I'm removing the blanks in my measure, now my entire calendar table is showing up in the bar chart (see below). I need the bar chart to start from when the data series starts and yet display empty months after that.
What are some of the ways you guys have dealt with this (ideally in an automatic way)? I can probably come up with something but wanted to see what the best practices are out there (i.e. the most effective way of doing it.).
Thanks Guys!
Solved! Go to Solution.
Hi @adin ,
Create a measure like this and apply it to visual level filter.
Measure = var min_ = CALCULATE(MIN(Sheet2[Date]),ALLEXCEPT(Sheet2,Sheet2[customer]))
var max_ = CALCULATE(MAX('calendar'[Date]))
return IF(max_>min_,1)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @adin ,
Create a measure like this and apply it to visual level filter.
Measure = var min_ = CALCULATE(MIN(Sheet2[Date]),ALLEXCEPT(Sheet2,Sheet2[customer]))
var max_ = CALCULATE(MAX('calendar'[Date]))
return IF(max_>min_,1)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
One way is to add an IF into your expression to compare the MIN(Date[Date]) to the overall MIN of your fact table
CALCULATE(MIN(Table[Date]), ALL(Table)). That way, any months will be blank prior to the overall min, and not show in the visual.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Would I use CALCULATE(MIN(Table[Date]), ALLSELECTED(Table)) if I want my bar chart to dynamically respond to which customer the user selected from a drop-down filter?
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |