Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi folks,
I ran into a problem when trying to display icons for weather forecast in my PBI dashboard. To give you a bit more detail - I need to show icons for current week (which is selected in the slicer), last week and same week last year (these two are measures), and I have successfully imported the icons, but the problem is that the icons are only related to the weather column for current week. Here is the relationship overview:
As you can see, only relationship is between column Weather (for selected week) and Weather from the Weather Icons table (in that table is the unique list of weather descriptions and icon URLs). My question is, how can I link the measures Weather Last Week and Weather Last Year to the Weather Icons table?
As things stand now, weather icons are not showing properly when either Weather Last Week or Weather Last Year are displayed on a visual:
Is there a solution for this problem? I would kindly appreciate if somebody could point me in the right direction...
Best regards!
Solved! Go to Solution.
Hi @DJOXXXA
You can create another Measure for previous week, year icon using same logic as you did to return the description or use something like below.
PrevIcon = VAR _prev = { [PrevDesc] } RETURN CALCULATE( SELECTEDVALUE( icons[Icon] ), ALL( icons ), TREATAS( _prev, icons[Desc] ) )
This measure will use the result of your current measures and find the corresponding icons, like below.
Hi @DJOXXXA
What method do you use to filter last week / last year, is dax measure or relative date filtering?
Hi @Mariusz,
Due to the requirement to compare Monday from this week with Monday from the last week or with Monday from the same week last year, I have introduced additional helper columns in my calendar, in order to calculate these values as easily as possible.
So, measure for the Weather last week looks like this:
Weather Last Week = CALCULATE(VALUES(Weather[Weather]); FILTER(ALL('Calendar');'Calendar'[LW Helper Column] = MAX('Calendar'[LW Helper Column]) -1) )
and the LW Helper Column is a nothing more than a calculated column:
LW Helper Column = Weekday * 1000000 + Cumulative Week
I know this is not "by the book" solution, but I havent found any other way to match weeks on weekday basis. Almost same measure formula is used for Last year calculation, but with different helper column (just replace LW Helper with LY Helper):
LY Helper Column = Weekday * 1000000 + Week * 10000 + Year
Hi @DJOXXXA
You can create another Measure for previous week, year icon using same logic as you did to return the description or use something like below.
PrevIcon = VAR _prev = { [PrevDesc] } RETURN CALCULATE( SELECTEDVALUE( icons[Icon] ), ALL( icons ), TREATAS( _prev, icons[Desc] ) )
This measure will use the result of your current measures and find the corresponding icons, like below.
Dear @Mariusz, thank you very much, you are a genius! It is working perfectly 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
130 | |
80 | |
53 | |
38 | |
35 |
User | Count |
---|---|
204 | |
81 | |
71 | |
53 | |
50 |