Forum Discussion
DAX - Percentile Calculation at different granularity
No, I do not have an explicit Date table. I am using the inbuilt date hirearchy "Month" column in the visual
So It would be better to add a Date table to your model then it will be easier to find a solution.
How to create a Date table:https://www.vahiddm.com/post/creating-calendar-table-with-3-steps
Can you share a sample of your PBIX file after removing sensetive data?
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
- VahidDM4 years ago
Super User
Try these two:
Quartile 2_City = VAR _A = SUMMARIZE( Sheet1, Sheet1[Date], Sheet1[City], "M", [Margin] ) RETURN PERCENTILEX.EXC( _A, [M], .5 )Quartile_Country = VAR _A = SUMMARIZE( Sheet1, Sheet1[Date], Sheet1[Country], "M", [Margin] ) RETURN PERCENTILEX.EXC( _A, [M], .5 )Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/ - 23664 years ago
Helper I
Both of them are returning same values 😞
- 23664 years ago
Helper I
I have shared it in DM. I have applied the date table now
- VahidDM4 years ago
Super User
Change Country to this:
Quartile_Country = VAR _A = calculatetable(SUMMARIZE( Sheet1, Sheet1[Date], Sheet1[Country], "M",[Margin]),removefilters(Sheet1[City])) RETURN PERCENTILEX.EXC( _A, [M], .5 )If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/ - 23664 years ago
Helper I
Sorry, that doesn't seem to change either