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.
Question: I am trying to analyzr video game dataset, analyzing data from the 'Table1 ’ table. This table contains information about various video games, including their hitrate, game type, winrate, release date, and other details. Some game names may be repeated in the table. i want to create a combined DAX measure named ‘CombinedDAX’ that calculates the rank of the most recent games where the ‘MinDateFlag’ is 1.
e.
Additionally, MinDateFlag represents a flag indicating the minimum release date for each game, even if the game name is repeated in the table. It is calculated
based on the release date of each game. If the release date of a game matches the minimum release date for that game, the MinDateFlag is set to 1; otherwise, it is set to 0.
I tried this its not working please help, attached a sample file
- CombinedDAX =
VAR MinDateFlag =
IF(
‘Dim Game’[Release Date] = CALCULATE(MIN(‘Dim Game’[Release Date]), ALLEXCEPT(‘Dim Game’, ‘Dim Game’[Game Name])),
1,
0
)
VAR RecentGamesRank =
IF(
MinDateFlag = 1,
RANKX(
FILTER(‘Dim Game’, MinDateFlag = 1),
‘Dim Game’[Release Date],
,
DESC,
Dense
),
BLANK()
)
RETURN
RecentGamesRank
Hi,
I am not sure how your semantic model looks like, but please try something like below whether it suits your requirement.
CombinedDAX =
VAR _currentgamename = 'Dim Game'[Game Name]
VAR _mindate =
MINX (
FILTER ( 'Dim Game', 'Dim Game'[Game Name] = _currentgamename ),
'Dim Game'[Release Date]
)
VAR RecentGamesRank =
IF (
'Dim Game'[Release Date] = _mindate,
RANKX (
FILTER ( 'Dim Game', 'Dim Game'[Release Date] = _mindate ),
'Dim Game'[Release Date],
,
DESC,
DENSE
),
BLANK ()
)
RETURN
RecentGamesRank
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you for responding, but unfortunately, the solution provided isn't producing the expected results. It's returning either 1 or blank values. In my original approach, although I had ranks, they weren't continuous.
Here's how my table looks:
Game Name | Turnover | Game Type | Payout | GameLaunchDate | MinDateFlag | RecentGamesRank | CombinedDAX |
Call of Duty: Warzone | $500,000 | Battle Royale | $250,000 | March 10, 2020 | 1 | 1 | 1 |
Call of Duty: Warzone | $600,000 | Battle Royale | $300,000 | April 15, 2021 | 0 | null | null |
Among Us | $200,000 | Social deduction | $100,000 | June 15, 2018 | 1 | 2 | 2 |
Fort1 | $1,000,000 | Battle Royale | $500,000 | July 25, 2017 | 1 | 3 | 3 |
Fort | $1,200,000 | Battle Royale | $600,000 | August 30, 2018 | 0 | null | null |
Minecraft | $800,000 | Sandbox | $400,000 | November 18, 2011 | 1 | 4 | 4 |
Minecraft | $900,000 | Sandbox | $450,000 | December 21, 2012 | 0 | null | null |
League of Legends | $1,500,000 | MOBA | $750,000 | October 27, 2009 | 1 | 5 | 5 |
League of Legends | $2,000,000 | MOBA | $1,000,000 | November 20, 2010 | 0 | null | null |
PUBG | $700,000 | Battle Royale | $350,000 | December 20, 2017 | 1 | 6 | 6 |
PUBG | $750,000 | Battle Royale | $375,000 | January 25, 2019 | 0 | null | null |
Among Us | $300,000 | Social deduction | $150,000 | July 15, 2020 | 0 | null | null |
Minecraft | $1,000,000 | Sandbox | $500,000 | May 10, 2021 | 1 | 7 | 7 |
Minecraft | $1,200,000 | Sandbox | $600,000 | June 30, 2022 | 0 | null |
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 |
---|---|
46 | |
26 | |
21 | |
12 | |
8 |
User | Count |
---|---|
75 | |
52 | |
45 | |
15 | |
12 |