Forum Discussion
Q&A visual setup- how to define an operation like difference from, change from etc.?
- Anonymous2 years ago
Hi ashishd
Jihwan_Kim Thank you very much for your prompt reply and here allow me to share some of it.
It sounds like you want the Q&A feature to understand and calculate the difference in sales between two dates, specifically the latest date and the previous date.
An effective way to deal with this issue is to create a measure in the Power BI model that is used to calculate the difference in sales between the latest date and the previous date.
Once you have this measure, you can ask the Q&A visual object to display the measure.
Diff = var _maxdate = MAX('Sheet1'[Date]) var _PreviousDate = CALCULATE(SUM(Sheet1[Metric]), FILTER(ALL('Sheet1'), 'Sheet1'[Date] = _maxdate - 1)) var _LastDate = CALCULATE(SUM(Sheet1[Metric]), FILTER(ALL('Sheet1'), 'Sheet1'[Date] = _maxdate)) return _LastDate - _PreviousDateWhile you cannot directly define operations like "change" or "difference" in the Q&A setup window, you can use it to define synonyms for measures or columns that might help guide the Q&A feature towards the pre-calculated measure you've created.
You can ask as suggested by Q&A.
Here is the result.
Use Power BI Q&A to explore and create visuals in your reports - Power BI | Microsoft Learn
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.