March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have the data from May 2023 to till date and I need to show the average current month data in the card visual. Data will have the Transaction date, Adoption % and the store list. The report will be refreshed on a daily basis, but it have data 1 week prior to the current week. (If the report is refreshed on 3rd June, the data available in the report is 26th may to 1st June but we consider that as 26th May data). The requirement is showing recent month data, I used the Current Month formula to show the data it worked perfectly until May 31st, when it refreshed on June 1st it shows no data available.
I need help to show the current month data in the card visual with the available data in the report.
For example, Data available in the report till May 2024 when the data refreshed on 1st June it has to show the current available data (Month).
Used Dax =
StoreName | StoreNo | Txn Dt | New Adoption |
AA | 11 | 5th May 2024 | 10 |
BB | 22 | 5th May 2024 | 20 |
CC | 33 | 5th May 2024 | 30 |
AA | 11 | 12th May 2024 | 50 |
BB | 22 | 12th May 2024 | 10 |
CC | 33 | 12th May 2024 | 25 |
AA | 11 | 19th May 2024 | 100 |
BB | 22 | 19th May 2024 | 95 |
CC | 33 | 19th May 2024 | 36 |
AA | 11 | 26th May 2024 | 55 |
BB | 22 | 26th May 2024 | 66 |
CC | 33 | 26th May 2024 | 100 |
Total | 49.75 | ||
Solved! Go to Solution.
Ok. Here is a pbix file that has your example data. I created two measures and a calculated column and ended up with the values you are looking for.
Proud to be a Super User! | |
Hi @Krishna_Newuser ,
I think this happens because you have data from multiple years.
The following DAX expression does not take the year into consideration, the maximum month is 6, and the data for 2023 and 2024 are calculated.
The Table data is shown below:
Use the following DAX expression to create a measure
Measure =
VAR _summarizeTable = ADDCOLUMNS(SUMMARIZE('Table','Table'[Txn Dt],"average",AVERAGE('Table'[New Adoption])),"month",MONTH([Txn Dt]),"year",YEAR([Txn Dt]))
VAR _maxMonthNumber = MONTH(MAX('Table'[Txn Dt]))
VAR _maxYearNumber = YEAR(MAX('Table'[Txn Dt]))
VAR _rowscount = COUNTROWS(FILTER(_summarizeTable,[month] = _maxMonthNumber && [year] = _maxYearNumber))
VAR _averageOfNewAdoption = SUMX(FILTER(_summarizeTable,[month] = _maxMonthNumber && [year] = _maxYearNumber),[average])
RETURN DIVIDE(_averageOfNewAdoption,_rowscount,0)
Final output
If the error persists, can you share the .pbix file without the sensitive data?
Best Regards,
Wenbin Zhou
If this post helps,Please mark me and @jgeddes as the solution.
If you have your date column formatted as above like '5th May 2024' you will need to change it to an acutal date format for it to work.
Proud to be a Super User! | |
@jgeddes
I cannot change the format of the data as the report refresh only on weekly basis and it will have only the weekly data. We are using the Power Automate to save the historical data in one of excel which have these format.
Is there anything else we can do to make the changes.
Thank you for understanding!!!
Are you importing the data or is it coming in via Direct Query?
Proud to be a Super User! | |
Hi,
Data is available in the sharepoint and in CSV format, we are just importing the data.
I used the below query which you have asked to modify it, below is the screenshot of the error. It didnt worked, unable to figure it out to make any changes here.
i used this query and its showing the value as 49% but based on june 2024 it has to be 47.
I may be misunderstanding a bit. Where are you getting June data from? In your original post you provided data that falls entirely in May.
Proud to be a Super User! | |
This week data is refreshed. Now june 2nd data available.
For E:G, If the data is refreshed on 1st July 2024, the data will have the details of 23rd June 2024. In that period, it should give the data of overall % of inclusive June month instead of 1st July.
Likewise when the data refreshed on 8th July, it will have 30th June and all this data will be considered under June Month.
When the data is refreshed on 15th July, it will have the data of 8th July. Hence it will be considered under July Month Data. It has to automatically update the July data in the card.
Ok. Thank you for the clarification. That is what I understund initially. Can you share a sample of the new June data in the same format as your original post? Otherwise I will not be able to troubleshoot why the June results do not align.
Proud to be a Super User! | |
Hello,
Please find the below data,
StoreName | StoreNo | Txn Dt | New Adoption |
AA | 11 | 5th May 2024 | 10% |
BB | 22 | 5th May 2024 | 20% |
CC | 33 | 5th May 2024 | 30% |
AA | 11 | 12th May 2024 | 50% |
BB | 22 | 12th May 2024 | 100% |
CC | 33 | 12th May 2024 | 25% |
AA | 11 | 19th May 2024 | 100% |
BB | 22 | 19th May 2024 | 95% |
CC | 33 | 19th May 2024 | 36% |
AA | 11 | 26th May 2024 | 55% |
BB | 22 | 26th May 2024 | 66% |
CC | 33 | 26th May 2024 | 100% |
AA | 11 | 2nd June 2024 | 88% |
BB | 22 | 2nd June 2024 | 25% |
CC | 33 | 2nd June 2024 | 33% |
May | |
Total | 49.75% |
June | |
Total | 49% |
Hi,
Thank you for the help!!! When i added the whole data in the PBIX which you shared, its providing the result of 49%. I have used the same measure which you have given, if we added the overall data, i think some challenge occurs.
Date Converstion not required since my date format is already updated in Long date format.
If you replace all instances of the DateConversion column in my measure with the TxnDt column in your set it "should" work.
Proud to be a Super User! | |
Though i have the same data format, do i need to create the data conversion?
If so, i have done that but it shows error.
Hi @jgeddes ,thank you for your quick reply, I think your answer is correct.
Hi @Krishna_Newuser ,
The answer is no. Column 'TxnDt' initially has a data type of 'Text'. This does not allow filtering of the data. So need to create column 'data conversion' with data type 'Date'. You mentioned that you have converted the data type of column 'TxnDt' to 'Date'. This will work. Regarding the error in your image, 'Left','Find','Right' are text functions, but the data type of column 'TxnDt' has been converted to 'Date'. Please mark @jgeddes 's answer as a solution.
Hello,
Thank you for the reply. Request you to check on the previous response, i have used the 1 year data which i have in the system by trying the measue which updated in the report. It shows the overall % of 49 instead of 47. Can you help on this please.
Hi @Krishna_Newuser ,
I think this happens because you have data from multiple years.
The following DAX expression does not take the year into consideration, the maximum month is 6, and the data for 2023 and 2024 are calculated.
The Table data is shown below:
Use the following DAX expression to create a measure
Measure =
VAR _summarizeTable = ADDCOLUMNS(SUMMARIZE('Table','Table'[Txn Dt],"average",AVERAGE('Table'[New Adoption])),"month",MONTH([Txn Dt]),"year",YEAR([Txn Dt]))
VAR _maxMonthNumber = MONTH(MAX('Table'[Txn Dt]))
VAR _maxYearNumber = YEAR(MAX('Table'[Txn Dt]))
VAR _rowscount = COUNTROWS(FILTER(_summarizeTable,[month] = _maxMonthNumber && [year] = _maxYearNumber))
VAR _averageOfNewAdoption = SUMX(FILTER(_summarizeTable,[month] = _maxMonthNumber && [year] = _maxYearNumber),[average])
RETURN DIVIDE(_averageOfNewAdoption,_rowscount,0)
Final output
If the error persists, can you share the .pbix file without the sensitive data?
Best Regards,
Wenbin Zhou
If this post helps,Please mark me and @jgeddes as the solution.
Thank you so much for the help. its working fine now, hope it will be working when the july month refresh occurs.
You can try the following and see if it gives you your desired result.
Instead of MONTH(NOW()) and YEAR(NOW()) you can use MONTH(MAXX(ALL('Adoption Trend_Dup'), [TxnDt])) and YEAR(MAXX(ALL('Adoption Trend_Dup'), [TxnDt])).
This will take the month and year from the max date that exists in your table.
Proud to be a Super User! | |
Hello,
Thank you for the reply, i have tried the DAX, it didnt worked.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
76 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |