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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
UpharAnand
Helper II
Helper II

Segment not working.

Hi All,

 

For god sake please help me. I have attached the power BI report as well, Kindly download it.

 

I want to show the count of users who have spent money as per the given segment but my dax formula is showing weird result. "Lifetime value 6m rolling users" means count of users..

Even sum of revenue is also showing incorrect result. ""Lifetime revenue 6m rolling users" means 6 month rolling sum

 

I have to show this as 6 month rolling.

Humble request please hele me with the correct dax function.

Please click the link to download the file: https://drive.google.com/file/d/1CnK7sFEjoMm0-zwoLhOgk9pvzkRdGQv3/view?usp=drivesdk 

UpharAnand_0-1718096813150.png

 

1 ACCEPTED SOLUTION
v-linyulu-msft
Community Support
Community Support

Hi,@UpharAnand 

1.create relationships between tables:

vlinyulumsft_0-1718171491850.png

2.Change the data type of all date-related columns to Date.

vlinyulumsft_1-1718171505455.png

3. Below are the measure I've created for your needs:

Measure = CALCULATE(SUM(revenue[Net Revenue GBP]),FILTER(ALL('revenue'),Revenue[order_Status] in {"COMPLETED","confirmed","Complete"}&&'revenue'[order_date]<=MAX('revenue'[order_date])&&not(ISBLANK(revenue[ecosystem_entry_date]))&&'revenue'[order_date]>DATE(2023,10,1)&&'revenue'[order_date]<DATE(2024,3,31)))
Measure 2 = 
CALCULATE(COUNTROWS('revenue'),FILTER(DISTINCT('revenue'), [Measure]>=MAX(Segment[Min])&&[Measure]<max(Segment[Max])))

4.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1718171569402.png

If I have misunderstood, I hope you can provide an alternative thus enabling me to understand your needs.We can better understand the problem and help you.


Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-linyulu-msft
Community Support
Community Support

Hi,@UpharAnand 

1.create relationships between tables:

vlinyulumsft_0-1718171491850.png

2.Change the data type of all date-related columns to Date.

vlinyulumsft_1-1718171505455.png

3. Below are the measure I've created for your needs:

Measure = CALCULATE(SUM(revenue[Net Revenue GBP]),FILTER(ALL('revenue'),Revenue[order_Status] in {"COMPLETED","confirmed","Complete"}&&'revenue'[order_date]<=MAX('revenue'[order_date])&&not(ISBLANK(revenue[ecosystem_entry_date]))&&'revenue'[order_date]>DATE(2023,10,1)&&'revenue'[order_date]<DATE(2024,3,31)))
Measure 2 = 
CALCULATE(COUNTROWS('revenue'),FILTER(DISTINCT('revenue'), [Measure]>=MAX(Segment[Min])&&[Measure]<max(Segment[Max])))

4.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1718171569402.png

If I have misunderstood, I hope you can provide an alternative thus enabling me to understand your needs.We can better understand the problem and help you.


Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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