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.
I would like to create a measure "forecast" by checking the quarter selected and display different set of values.
The result for each quarter is correct as shown in table below. however the total is blank. how do i go about get the total of Quarter 1 to 4.
thanks.
Quarter | 1 | 2 | 3 | 4 | Total |
Forecast | Forecast | Forecast | Forecast | Forecast | |
200 | 100 | 150 | 400 |
Solved! Go to Solution.
Hi @evez ,
You can try this-
Forecast =
IF(
HASONEVALUE(all_rates_v[fiscal_quarter]),
SWITCH(
TRUE(),
VALUES(all_rates_v[fiscal_quarter]) = 1, [Actual],
VALUES(all_rates_v[fiscal_quarter]) = 2, [Actual],
VALUES(all_rates_v[fiscal_quarter]) = 3, [forecast],
VALUES(all_rates_v[fiscal_quarter]) = 4, [budget]
),
[Actual] + [Actual] + [forecast] + [budget]
)
Here HASONEVALUE checks if only one quarter is selected.
Hope this helps!
Hi @evez ,
You can try this-
Forecast =
IF(
HASONEVALUE(all_rates_v[fiscal_quarter]),
SWITCH(
TRUE(),
VALUES(all_rates_v[fiscal_quarter]) = 1, [Actual],
VALUES(all_rates_v[fiscal_quarter]) = 2, [Actual],
VALUES(all_rates_v[fiscal_quarter]) = 3, [forecast],
VALUES(all_rates_v[fiscal_quarter]) = 4, [budget]
),
[Actual] + [Actual] + [forecast] + [budget]
)
Here HASONEVALUE checks if only one quarter is selected.
Hope this helps!
@v-sdhruv thanks it works. but i change the code a bit to fit my need.
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your threadconsider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
@FBergamaschi thanks for your reply. but it seems not working. now the quarterly number is incorrect too. while the total is still blank. any other way to work around?
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |