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,
I have fair knowledge in Power BI , not able to figure out one piece of puzzle.
I have a simple table below data
Sample Data:
enddate | status | Brand | Due |
11/2/2022 | Failed | Lenova | 1 |
12/10/2022 | Failed | Microsoft | 1 |
1/22/2023 | Failed | Microsoft | 1 |
3/10/2023 | Failed | Microsoft | 1 |
3/28/2023 | Complete | Microsoft | 1 |
3/30/2023 | Ontrack | Microsoft | 1 |
4/10/2023 | Ontrack | Lenova | 1 |
4/17/2023 | Risk | Lenova | 1 |
5/31/2023 | Risk | Microsoft | 1 |
5/30/2023 | Ontrack | HP | 1 |
5/10/2023 | Ontrack | Lenova | 1 |
11/10/2023 | Risk | Microsoft | 1 |
12/10/2023 | InProgress | HP | 1 |
1/10/2024 | Risk | Microsoft | 1 |
Expected Result :
Clients wants count of status by Months . (Conditions are)
Please attach pbix file if u can resolve
Solved! Go to Solution.
Here's one approach. You can add a calculated column with the expression below and then use it in your visual (filtering out the two More Than values). You'll also need to work out a sort-by column to get them in your desired order.
MonthForVisual =
VAR thisSOM =
EOMONTH ( 'Status'[enddate], -1 ) + 1
VAR todaySOM =
EOMONTH ( TODAY (), -1 ) + 1
VAR MonthsDiff =
DATEDIFF ( todaySOM, thisSOM, MONTH )
RETURN
SWITCH (
TRUE (),
MonthsDiff < -3, "MT 3 Mos Ago",
MonthsDiff < 0, "Prev 3 Mos",
MonthsDiff < 4, FORMAT ( 'Status'[enddate], "MMM" ),
"MT 3 Mos From Now"
)
Pat
Here's one approach. You can add a calculated column with the expression below and then use it in your visual (filtering out the two More Than values). You'll also need to work out a sort-by column to get them in your desired order.
MonthForVisual =
VAR thisSOM =
EOMONTH ( 'Status'[enddate], -1 ) + 1
VAR todaySOM =
EOMONTH ( TODAY (), -1 ) + 1
VAR MonthsDiff =
DATEDIFF ( todaySOM, thisSOM, MONTH )
RETURN
SWITCH (
TRUE (),
MonthsDiff < -3, "MT 3 Mos Ago",
MonthsDiff < 0, "Prev 3 Mos",
MonthsDiff < 4, FORMAT ( 'Status'[enddate], "MMM" ),
"MT 3 Mos From Now"
)
Pat
Awesome got your solution . it works .
Any simple solution it can be sorted.
@snarasi_83 You'll need to use a disconnected table as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...
@Greg_Deckler I tried but i am not able to figure out the first condition.
Any other option ? or implementation . If solved please upload pbix file
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 |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |