Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Group,
A question on the Time Intelligence functions... I have a matrix visual, and one of the measures is a month on month change... That I can do, and it works, however the requirement is that the same sort of calculation also works at other levels of the date hierarchy, so for instance if the user wants to view just at the year level, the result they see is the year on year change... at the moment because I have a measure which uses PREVIOUSMONTH, when the user views at the Year level the measure is still trying to show a month on month change...
The question is, how can make this visual work so that the change shows, and is based on the level the user is currently viewing at?
Cheers,
Andy
Solved! Go to Solution.
You need to create additional measures fo different granilarity and then create measure with SWITCH function:
GAP_Chg =
SWITCH (
TRUE (),
ISINSCOPE ( DATE_DIMENSION[Month] ), [GAP_Mom_Chg],
ISINSCOPE ( DATE_DIMENSION[Quarter] ), [GAP_QoQ_Chg],
ISINSCOPE ( DATE_DIMENSION[Year] ), [GAP_YoY_Chg]
)By using this measure in the matrix/chart you can easily change MoM to YoY etc.
_______________
If I helped, please accept the solution and give kudos! 😀
@andybamber , I have part of it created in this blog
Last Period Employee =
var _min_date = minx(all('Date'),'Date'[Date])
var _Expression=if(ISFILTERED('Date'[Month Year]),maxx('Date',DATEADD('Date'[Date],-1,MONTH)),maxx('Date',DATEADD('Date'[Date],-1,YEAR)))
Return
CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=_Expression && Employee[Start Date]>=_min_date && (ISBLANK(Employee[End Date]) || Employee[End Date]>_Expression)),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))
check the usage of isfiltered. The same way you can use isinscope
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
also refer
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...
https://www.youtube.com/watch?v=vlnx7QUVYME
Hi @andybamber
You can use INSCOPE function to easily change the measure based on the level on which user is.
Please check this article: https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
If you can then please share your measure and I will help you.
_______________
If I helped, please accept the solution and give kudos! 😀
Hello There!
this is what i'm using...
GAP_Mom_Chg = CALCULATE([Gap_Rec_Need]) - CALCULATE([Gap_Rec_Need],PREVIOUSMONTH(DATE_DIMENSION[Date Key]))
Cheers
Andy
You need to create additional measures fo different granilarity and then create measure with SWITCH function:
GAP_Chg =
SWITCH (
TRUE (),
ISINSCOPE ( DATE_DIMENSION[Month] ), [GAP_Mom_Chg],
ISINSCOPE ( DATE_DIMENSION[Quarter] ), [GAP_QoQ_Chg],
ISINSCOPE ( DATE_DIMENSION[Year] ), [GAP_YoY_Chg]
)By using this measure in the matrix/chart you can easily change MoM to YoY etc.
_______________
If I helped, please accept the solution and give kudos! 😀
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 33 | |
| 29 | |
| 26 |
| User | Count |
|---|---|
| 135 | |
| 103 | |
| 65 | |
| 61 | |
| 55 |