Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
So I have thru an autocalendar periods/monts/monthnr etc.
Now I want to find automatically the last period that has data.
In my source at the moment this is 09-2022.
However when I uses MAX([Period]) I get 12-2022.
But there is no data (yet) for months above 09-2022.
Is there a way to configure the MAX so that it only looks for a period that also has data?
Solved! Go to Solution.
Hi @rpinxt ,
You can create a measure as below to get it:
Sum of sales = SUM('Table'[sale])
Measure = CALCULATE ( MAX ( 'Table'[Period] ), FILTER ( 'Table', [Sum of sales] > 0 ) )
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Thanks @v-yiruan-msft with your example I was able to make it work.
However had to make some changes as the period format caused it to not work:
Hi,
Create a Calendar Table. Create a relationship (Many to One and Single) from the Date column of the Data Table to the Date column of the Calendar Table. Write these measures
Total = sum(Data[Sales])
Last date of sale = calculate(max(Calendar[Date]),filter(values(Calendar[Date]),[Total>0]))
Hope this helps.
Thanks @v-yiruan-msft but somehow it is not working for me:
Actually what I was trying to do I now fixed it with relative date (should have thought earlier about that! 🤦♂️)
However the question is still there....how could I achieve that the formula gives me the latest date with data.
And not 12-2022 which is the latest date in autocalendar and also not 12-2021.
But in this case 09-2022.
Hi @rpinxt ,
In order to make troubleshooting and give you a suitable solution quickly, could you please provide some sample data in your table 'A********erge' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @rpinxt ,
You can create a measure as below to get it:
Sum of sales = SUM('Table'[sale])
Measure = CALCULATE ( MAX ( 'Table'[Period] ), FILTER ( 'Table', [Sum of sales] > 0 ) )
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Thanks @v-yiruan-msft with your example I was able to make it work.
However had to make some changes as the period format caused it to not work:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |