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.
Hi All,
I want to find the New Country added to the system compared to previous years as seen in the following screen print, I need a measue to find which country was added this year compared to last year, so i need "Belgium" as my Output in the measure. Thanks
Ex :- For year 2022 it was "France" and for current year 2023 it is "Belgium" so I need "Belgium" as my output in the measure.
Reards
Suhel
Solved! Go to Solution.
Hi @Suhel_Ansari,
You can use the year as condition to filter table records to get two list of countries. (the first condition is filtering the records year less than current year; the second condition filter the records less than and equal to current year)
Then you can use except function to compare these lists to get the new added country list, check the current country if it included in the list and return flags.
EXCEPT function (DAX) - DAX | Microsoft Learn
The IN operator in DAX - SQLBI
Regards,
Xiaoxin Sheng
Hi @Suhel_Ansari,
You can use the year as condition to filter table records to get two list of countries. (the first condition is filtering the records year less than current year; the second condition filter the records less than and equal to current year)
Then you can use except function to compare these lists to get the new added country list, check the current country if it included in the list and return flags.
EXCEPT function (DAX) - DAX | Microsoft Learn
The IN operator in DAX - SQLBI
Regards,
Xiaoxin Sheng
Many Thank you for the Reply this the above solution I was about to achieve the output many.
Follwoing Measure give the Output.
1 Final Measure =
VAR Lvalues =
CALCULATETABLE( VALUES(Table[Country]),FILTER( Table , Table[DeliveryDate].[Year] = YEAR( TODAY())-1))
VAR Cvalues =
CALCULATETABLE( VALUES(Table[Country]), FILTER( Table , Table[DeliveryDate].[Year] = YEAR( TODAY()) ))
VAR OTable = EXCEPT( Cvalues , Lvalues)
VAR CResult = COUNTROWS( OTable )
VAR Result = CONCATENATEX( OTable , Table[Country] , ", ")
RETURN
IF( ISBLANK(CResult) , "No New Country" , Result)
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 |
---|---|
103 | |
103 | |
87 | |
73 | |
66 |
User | Count |
---|---|
119 | |
111 | |
95 | |
79 | |
72 |