Forum Discussion
How to show distinct strings month to month
Hi you7777
Can you please try below dax?
ChangedAppLabels =
VAR CurrentMonthLabels =
SELECTCOLUMNS(
FILTER(
'Zylo Trending',
'Zylo Trending'[DB Loading Date] = MAX('Zylo Trending'[DB Loading Date])
),
"App Label", 'Zylo Trending'[App Label],
"DB Loading Date", 'Zylo Trending'[DB Loading Date]
)
VAR PreviousMonthLabels =
SELECTCOLUMNS(
FILTER(
'Zylo Trending',
'Zylo Trending'[DB Loading Date] =
EDATE(MAX('Zylo Trending'[DB Loading Date]), -1)
),
"App Label", 'Zylo Trending'[App Label],
"DB Loading Date", 'Zylo Trending'[DB Loading Date]
)
VAR AddedLabels =
EXCEPT(CurrentMonthLabels, PreviousMonthLabels)
VAR RemovedLabels =
EXCEPT(PreviousMonthLabels, CurrentMonthLabels)
RETURN
UNION(
SELECTCOLUMNS(
AddedLabels,
"Change Type", "Added",
"App Label", [App Label],
"DB Loading Date", [DB Loading Date]
),
SELECTCOLUMNS(
RemovedLabels,
"Change Type", "Removed",
"App Label", [App Label],
"DB Loading Date", [DB Loading Date]
)
)
This revised query should correctly identify added or removed labels between snapshots.
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
So this only returned the last 2 months, and it returned all the apps (i just turned it into a count for better understanding). Rather, I need just the labels that are different between each month to be returned, on a month to month basis, ideally showing what was added and what was removed. In this case, it should just show 10 labels for the month of december.