Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
In power bi, i would like to figure out a way to compare Position ID's on a week to week basis. The results will be the exact position id's that are new(added) positions and removed positions from the data. the visuals will show the counts of new and removed positions, along with a second visual which can display the new and removed positions. The data table with position id's is uploaded into powerbi every wednesday and a source date column is added to identify when the data was uploaded, so every week there is a new source date added. The data table is not overwritten, it is added to the existing data table.. currently the data table has 6 weeks of data. Position Id's are a sequence of 8 numbers, all ids are unique.
Thanks in advance for your help!
Solved! Go to Solution.
Hi @rasputin ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Max_ID =
var _maxdate=
MAXX(ALL('Table'),'Table'[Date])
var _week=
WEEKNUM(_maxdate,2)
return
MAXX(
FILTER(ALL('Table'),
WEEKNUM('Table'[Date],2) = _week-1&&'Table'[Group]=MAX('Table'[Group])),[Location ID])
comparisons =
IF(
MAX('Table'[Location ID])<> [Max_ID],1,0)
new_count =
SUMX(
FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[Date],2)=WEEKNUM(MAX('Table'[Date]),2)),[comparisons])
remove_count =
SUMX(
FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[Date],2)=WEEKNUM(MAX('Table'[Date]),2)&&'Table'[comparisons]=1),[comparisons])
new positions =
IF(
MAX('Table'[Location ID]) = [Max_ID],MAX('Table'[Location ID]),BLANK())
removed positions =
IF(
MAX('Table'[Location ID]) <>[Max_ID],[Max_ID],BLANK())
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @rasputin ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Max_ID =
var _maxdate=
MAXX(ALL('Table'),'Table'[Date])
var _week=
WEEKNUM(_maxdate,2)
return
MAXX(
FILTER(ALL('Table'),
WEEKNUM('Table'[Date],2) = _week-1&&'Table'[Group]=MAX('Table'[Group])),[Location ID])
comparisons =
IF(
MAX('Table'[Location ID])<> [Max_ID],1,0)
new_count =
SUMX(
FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[Date],2)=WEEKNUM(MAX('Table'[Date]),2)),[comparisons])
remove_count =
SUMX(
FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[Date],2)=WEEKNUM(MAX('Table'[Date]),2)&&'Table'[comparisons]=1),[comparisons])
new positions =
IF(
MAX('Table'[Location ID]) = [Max_ID],MAX('Table'[Location ID]),BLANK())
removed positions =
IF(
MAX('Table'[Location ID]) <>[Max_ID],[Max_ID],BLANK())
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
119 | |
116 | |
72 | |
64 | |
46 |