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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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:)
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 53 | |
| 42 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 121 | |
| 103 | |
| 46 | |
| 30 | |
| 24 |