Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Im trying to design a dashboard where based on my filter selection in column QM with values "Quarter" or "Month", my calculations on the table would change
My calculation
RETURN
CALCULATE (
but this is the error i get
how can i solve this?
Solved! Go to Solution.
Hi, i think the problem is VALUES returns a variable, not a fixed keyword.
You may need to update it to below for another try
VAR qm = SELECTEDVALUE('Quarter or Month'[QM], "None")
RETURN
SWITCH(
qm,
"Month", CALCULATE([IQ TAT <1 Day], DATEADD('DIM Date'[DATE_KY], -1, MONTH)),
"Quarter", CALCULATE([IQ TAT <1 Day], DATEADD('DIM Date'[DATE_KY], -1, QUARTER)),
BLANK()
)Hope this helps:)
You could use a calculation group, with separate items for month and quarter, e.g.
Month =
CALCULATE ( SELECTEDMEASURE(), DATEADD ( 'DIM Date'[DATE_KY], -1, MONTH ) )
Quarter =
CALCULATE ( SELECTEDMEASURE(), DATEADD ( 'DIM Date'[DATE_KY], -1, QUARTER ) )
Then put the calculation group into the slicer instead of the 'Quarter or Month' table you have currently.
You should be able to accomplish this using a field parameter, rather than a DAX measure/column. To do this, at the top of the screen go to this path: Modeling->New parameter->Fields. Then, select your Month and Quarter fields (assuming you have a date dimension in your model). You will then have a field parameter that lets you dynamically choose between either the Month or Quarter column in your date dimension.
Here's the documentation for Field Parameters as well, if you want to look further into them: Use report readers to change visuals (preview) - Power BI | Microsoft Learn
Hi, i think the problem is VALUES returns a variable, not a fixed keyword.
You may need to update it to below for another try
VAR qm = SELECTEDVALUE('Quarter or Month'[QM], "None")
RETURN
SWITCH(
qm,
"Month", CALCULATE([IQ TAT <1 Day], DATEADD('DIM Date'[DATE_KY], -1, MONTH)),
"Quarter", CALCULATE([IQ TAT <1 Day], DATEADD('DIM Date'[DATE_KY], -1, QUARTER)),
BLANK()
)Hope this helps:)
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 54 | |
| 47 | |
| 39 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 83 | |
| 70 | |
| 38 | |
| 28 | |
| 27 |