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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
yashwant101
Helper III
Helper III

In Q&A not able to filter based on last n quarters

Hi All,

 

I am trying to setup Q&A in Power BI. When I ask it to give me monthly data for sales, it gives me the correct answer. But when I put the questions as "Give me monthly sales data for last 4 Quarters", it does not understand the question and gives me random wrong visual. Has anybody faced this? And do you have solution for this?

 

Regrads,

Yashwant

2 ACCEPTED SOLUTIONS
pankajnamekar25
Memorable Member
Memorable Member

Hello @yashwant101 

Here are some points you should consider

Use a proper Date table with Month, Quarter, Year columns and mark it as a Date table.

Add synonyms in Q&A setup for terms like "quarter", "month", "sales".

Create DAX measures like "Total Sales" and "Sales Last 4 Quarters" using DATESINPERIOD().

Use "Teach Q&A" to train it on phrases like "last 4 quarters".

Rephrase the question (e.g., use "last 12 months" instead of "last 4 quarters").

 

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

grazitti_sapna
Super User
Super User

Hi @yashwant101 

1. Use a well-structured Date table
Ensure you have a dedicated Date table marked as a Date Table in Power BI. Include columns like:

  • Year

 

  • Quarter



  • YearQuarter (e.g., "2023 Q1")


2. Create a measure for “Last 4 Quarters”

Sales_Last4Qtrs =
CALCULATE(
    [Total Sales],
    DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -12, MONTH)
)

3. Teach Q&A with suggested phrases
Go to Q&A setup > Teach Q&A, and define how it should interpret:

This can help Q&A map user language to your data model.

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

View solution in original post

5 REPLIES 5
v-sgandrathi
Community Support
Community Support

Hi @yashwant101,

 

Thank you Community members for the response.

 

Has your issue been resolved?If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.

 

Thank you for your understanding!

 

Hi @yashwant101,

Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If you've already resolved the issue, you can mark the helpful reply as a "solution" so others know that the question has been answered and help other people in the community. Thank you again for your cooperation!
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.

Thank you,
Tejaswi.


Hi @yashwant101,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and Accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you,
Tejaswi.

 

 

grazitti_sapna
Super User
Super User

Hi @yashwant101 

1. Use a well-structured Date table
Ensure you have a dedicated Date table marked as a Date Table in Power BI. Include columns like:

  • Year

 

  • Quarter



  • YearQuarter (e.g., "2023 Q1")


2. Create a measure for “Last 4 Quarters”

Sales_Last4Qtrs =
CALCULATE(
    [Total Sales],
    DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -12, MONTH)
)

3. Teach Q&A with suggested phrases
Go to Q&A setup > Teach Q&A, and define how it should interpret:

This can help Q&A map user language to your data model.

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

pankajnamekar25
Memorable Member
Memorable Member

Hello @yashwant101 

Here are some points you should consider

Use a proper Date table with Month, Quarter, Year columns and mark it as a Date table.

Add synonyms in Q&A setup for terms like "quarter", "month", "sales".

Create DAX measures like "Total Sales" and "Sales Last 4 Quarters" using DATESINPERIOD().

Use "Teach Q&A" to train it on phrases like "last 4 quarters".

Rephrase the question (e.g., use "last 12 months" instead of "last 4 quarters").

 

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.