Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
efilipe
Helper IV
Helper IV

Table LatDayAndroid and LastDayiOS

Hi guys,

 

I want to add two columns. First one with the MAX day for Android and second Max day for iOS. And set that column with 1 (true) and 0 (false);

 

Date SODaily Device InstallsDaily Device UninstallsDaily Device UpgradesTotal User InstallsDaily User InstallsDaily User Uninstalls
Active Device Installs
21/07/2017 Android1001101
22/07/2017 Android0001001
23/07/2017 Android0001001
24/07/2017 Android0111010
25/07/2017 Android0001000
26/07/2017 Android1030111037
27/07/2017 Android13372413317
29/07/2017 iOS22      
30/07/2017 iOS18      
31/07/2017 iOS75      
01/08/2017 iOS90      
02/08/2017 iOS58      
03/08/2017 iOS44      
04/08/2017 iOS48      
05/08/2017 iOS27      
06/08/2017 iOS20      
07/08/2017 iOS36      
08/08/2017 iOS56      
          
1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@efilipe

 

Hi, ok. Try with this measures

 

LastDayAndroid =
IF (
    Table1[Date]
        = CALCULATE (
            MAX ( Table1[Date] ),
            FILTER ( ALL ( Table1 ), Table1[SO] = "Android" )
        ),
    1,
    0
)

To IOS change "Android" to "IOS"

 

Img.png

 

Regards

 

Victor




Lima - Peru

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi @efilipe,

 

You may try this calculated field formula

 

=if(CALCULATE(MAX(Data[Date]),FILTER(Data,Data[SO]=EARLIER(Data[SO])))=Data[Date],1,0)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
efilipe
Helper IV
Helper IV

That means that the column "LastDayAndroid" will have value "1" on the line 27/07/2017 and all other "Android" will have 0;

And iOS "LastDayiOS" will have "1" on the line 08/08/2017 and all other iOS lines will have 0;

@Vvelarde better explained i think 🙂

@Greg_Deckler help? 🙂

Hi @efilipe,

Please try the solution other members posted, and mark the right or helpful reply as answer, so more people like will find workaround easily. After I test, all the formulas will return your expected result. Please feel free to ask if you haven't resolved it.

Best Regards,
Angelia 

try this 

Max Flag = var maxDate = Calculate(Max(iOS[Date]), AllExcept(iOS, iOS[SO]) ) return if(maxDate = max(iOS[Date]), 1, 0)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@Ashish_Mathurwhat is calculated field means? Calculated column or measure?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k,

 

It measns measure.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for the clarification because calculate field can be very confusing , that is why I asked. Smiley Happy



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Vvelarde
Community Champion
Community Champion

@efilipe

 

Hi, ok. Try with this measures

 

LastDayAndroid =
IF (
    Table1[Date]
        = CALCULATE (
            MAX ( Table1[Date] ),
            FILTER ( ALL ( Table1 ), Table1[SO] = "Android" )
        ),
    1,
    0
)

To IOS change "Android" to "IOS"

 

Img.png

 

Regards

 

Victor




Lima - Peru

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.