Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Facing issue with Parallelperiod Dax

Hi All,

         I am using the below dax query to get previous month sum of the data.

Consumption Dollars PM = Calculate([Consumption Dollars],PARALLELPERIOD(Dim_MasterCalendar[Date],-1,MONTH))
and its working as expected.
Note : Here Consumption Dollars is current month data that i have selected in month slicer
                   Consumption Dollars PM is the previous month of the selected month
1.PNG
But when i select 2 months like May+June it is showing May+June data instead March+April.
So my requirement is when i select 2 or 3 months it should show the previous 2 or 3 months data those are not in the selections.
please help me get my requirement.
2.jpg
1 ACCEPTED SOLUTION
AnkitBI
Solution Sage
Solution Sage

You can try something like below. 

-- COUNTROWS(ALLSELECTED(DimDate[EnglishMonthName]))- Is to get count of selected months. This will return blank as period if no month is selected.
Consumption Dollars PM = CALCULATE([Consumption Dollars],PARALLELPERIOD(DimDate[FullDateAlternateKey],-COUNTROWS(ALLSELECTED(DimDate[EnglishMonthName])),MONTH))

 

Thanks
Ankit Jain

Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.

View solution in original post

2 REPLIES 2
AnkitBI
Solution Sage
Solution Sage

You can try something like below. 

-- COUNTROWS(ALLSELECTED(DimDate[EnglishMonthName]))- Is to get count of selected months. This will return blank as period if no month is selected.
Consumption Dollars PM = CALCULATE([Consumption Dollars],PARALLELPERIOD(DimDate[FullDateAlternateKey],-COUNTROWS(ALLSELECTED(DimDate[EnglishMonthName])),MONTH))

 

Thanks
Ankit Jain

Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.

Anonymous
Not applicable

@AnkitBI Thank you so much Ankit its working..

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors