Forum Discussion
Victor_1706
7 years agoNew Member
How to order by weeks (chronologically)
Hello everyone. I have little time using Power BI and I am still adapting to the tool. I'm modeling data to show the total number of organizations for each of the stages in my sales process...
- 7 years ago
Hi Victor_1706,
I created one measure to get the count of days per organization.
Measure = VAR mindate = CALCULATE ( MIN ( deals[Último cambio de etapa] ), ALLEXCEPT ( deals, deals[Etapa] ) ) VAR maxdate = CALCULATE ( MAX ( deals[Último cambio de etapa] ), ALLEXCEPT ( deals, deals[Etapa] ) ) RETURN DATEDIFF ( mindate, maxdate, DAY )For more details, please check the pbix as attached.
Regards,
Frank
- 7 years ago
Hi Victor_1706,
Which column is the code? You can update the formula to it.
Measure = VAR mindate = CALCULATE ( MIN ( deals[Último cambio de etapa] ), ALLEXCEPT ( deals, deals[Etapa],deals[code] ) ) VAR maxdate = CALCULATE ( MAX ( deals[Último cambio de etapa] ), ALLEXCEPT ( deals, deals[Etapa],deals[code] ) ) RETURN DATEDIFF ( mindate, maxdate, DAY )Regards,
Frank
Greg_Deckler
Community Champion
7 years agoIf you need to span years, you can use my Sequential quick measure:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231