0

Okay, so I'm fairly new to DAX and not 100% sure this can be achieved. I have a table like below...
Current Output :
Current Output

And I am wanting to merge the 'Latest Weeks and yr ago' into groups such as 'Last 4,'Last 12' etc., this should make the table more readable. I tried grouping, but each value can only be in one group, and some would need to be in mulitple groups - (ie 'latest 01-04...' would be in all groups). The table above changes dynamically based on a slicer.

What I am trying to achieve is something like this....
What I'm aiming for :
What I'm aiming for

Like I say, not sure it is possible, but hoping someone might have an idea.

Thanks

Omar Shawky
  • 1,242
  • 1
  • 12
  • 25

1 Answers1

0

This is possible but a bit clunky.

One method is to set up a new parameter table to use for your column headers and define your measures to read that context and adjust accordingly. See this related post for an example of how this works.

Another, perhaps simpler, method would be to use calculation groups where Latest X Weeks are your calculation items with formulas along the lines of

---
--- Calculation Item: Latest 12 weeks
---
CALCULATE ( 
    SELECTEDMEASURE (),
    DATESTBETWEEN ( DimDate[Date], TODAY() - 12 * 7, TODAY () )
)

Note: You can't create calculation groups in Power BI Dekstop (yet), so you'll need an external tool like Tabular Editor. This is explained in the previous link.

Alexis Olson
  • 38,724
  • 7
  • 42
  • 64