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.
What happens when you select multiple months and/or years:
The resulting error message:
the measure:
Actuals less Forecast = VAR Today = MAX ( 'DateTable'[Date] ) VAR Month_End = EOMONTH ( TODAY (), 0 ) VAR SupplierProjMinusForecast = [Supplier Projected] - [Supplier Forecast] VAR Year_Row = VALUES ( 'DateTable'[Year] ) VAR Year_Today = YEAR ( TODAY () ) VAR Month_Row = VALUES ( 'DateTable'[MonthNumber] ) VAR Month_Today = MONTH ( TODAY () ) VAR Date_Compare = IF( OR( Year_Row < Year_Today, AND( Year_Row = Year_Today, Month_Row <= Month_Today ) ), SupplierProjMinusForecast, IF( Today <= Month_End, //in Richard's volume report, user can select only a year or a quarter, so month check above fails. To avoid calculating very misleading variance, calc is limited to only producing a result if date selection is up to the end of the current month SupplierProjMinusForecast ) ) Return Date_Compare
This line seems to be causing all of the problems when multiple months are selected.
VAR Month_Row = VALUES ( 'DateTable'[MonthNumber] )
How would I modify my measure, so that the visual functions properly?
Solved! Go to Solution.
Hi @eddd83,
Due to I could not reproduce your problem, could you please offer me some sample file to have a test or share the pbix file if possible?
Regards,
Daniel He
Hi @eddd83,
Due to I could not reproduce your problem, could you please offer me some sample file to have a test or share the pbix file if possible?
Regards,
Daniel He
I end up changing Year_Row and Month_Row from VALUES to MAX.
VAR Year_Row = VALUES ( 'DateTable'[Year] ) VAR Year_Today = YEAR ( TODAY () ) VAR Month_Row = VALUES ( 'DateTable'[MonthNumber] )
This seemed to produce the desired effect for my report.
Hi @eddd83,
It's pleasant that your problem has been solved, could you please mark your reply as Answered?
Regards,
Daniel He
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |