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
Hello,
I am trying to achieve the below table with calculation items. And the below DAX will return the variable result instead of the return value. For the Actual values I have the correct numbers and separate calculation item which works fine, but for Prior Period item it return the Actual values.
Table
Measure | Actual | Prior Period
Prior Period =
VAR Actual =
SWITCH (
SELECTEDVALUE ( 'MTD_YTD'[Num] );
1; SELECTEDMEASURE ();
2; CALCULATE (
SELECTEDMEASURE ();
FILTER ( 'Date_Dim'; DAY ( 'Date_Dim'[Date] ) < DAY ( TODAY () ) + 1 )
);
3; CALCULATE ( SELECTEDMEASURE (); DATESYTD ( 'Date_Dim'[Date] ) )
)
RETURN
SWITCH (
SELECTEDVALUE ( 'Prior Per'[Num] );
2; CALCULATE ( actual; PREVIOUSMONTH ( 'Date_Dim'[Date] ) );
3; CALCULATE ( actual; SAMEPERIODLASTYEAR ( 'Date_Dim'[Date] ) )
)
Hi @Anonymous ,
Please share me a dummy PBIX file without real data or sensitive information. Then I can carry out specific tests.
Best Regards,
Icey
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 40 | |
| 21 | |
| 18 |