The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello all,
Please help me figure out what's wrong. I have a visual that needs to show sum of decs by customer and it should show current year and prior year and I should be able to select any year AND any month (multiple months too if needed). My current year measure seems to work very well (first screenshot) but my prior year measure doesn't want to work (second screenshot) and it shows the total sum of decs for each customer. The third screenshot is what i have for the filters. My table is direct query, not import.
Solved! Go to Solution.
@yak8q8 Sounds like you will need to add a filter for your customer then. Grab you customer using MAX or SELECTEDVALUE and then add it to your filter clause.
@Greg_Deckler Greg, any ideas on how to make the visual load faster? Right now it's more than a minute for the visual to load. Hoping that adjusting the formulas will suffice.
@yak8q8 Sounds like you will need to add a filter for your customer then. Grab you customer using MAX or SELECTEDVALUE and then add it to your filter clause.
Hi Greg, thank you for your reply. Unfortunately the error I get is "there is not enough memory to complete this operation". Any other ideas?
@yak8q8 Try this:
ENTRY VOLUME PY =
VAR PRIORYEAR = SELECTEDVALUE('ft_DEC Dates'[Year]) - 1
VAR CURRMONTHS = DISTINCT('ft_DEC Dates'[Month])
VAR __TABLE = SUMMARIZE(FILTER(ALL('ft_DEC Dates'),[Year] = PRIORYEAR && [Month] IN CURRMONTHS),[Year], [Month], "__Value", SUM('ft_DEC Dates'[DEC SUM]) )
VAR __RETURN = SUMX( __TABLE, [__Value])
RETURN
__RETURN
@yak8q8 Couple problems. One, SELECTEDVALUE is not intended for selecting multiple values and you will get problems. Try this:
ENTRY VOLUME PY =
VAR PRIORYEAR = SELECTEDVALUE('ft_DEC Dates'[Year]) - 1
VAR CURRMONTHS = DISTINCT('ft_DEC Dates'[Month])
VAR __RETURN = SUMX(FILTER(ALL('Table'),[Year] = PRIORYEAR && [Month] IN CURRMONTHS),[DEC SUM])
RETURN
__RETURN
User | Count |
---|---|
24 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
9 | |
9 |