Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
After a lot of reading, i´m still managing a problem inserting two measures for cumulative totals in the same graph.
I have a table with two date columns (Dta.CONF, Liberacao Real) both relating to a calendar table.
I created two measures to calculate cumulative totals:
Realizado Acumulado = CALCULATE(SUM('IW39 Filtrada'[Cust.tot.reais]); FILTER(ALLSELECTED('IW39 Filtrada'); 'IW39 Filtrada'[dta.Conf] <= MAX('IW39 Filtrada'[dta.Conf])); USERELATIONSHIP(Datas[Date];'IW39 Filtrada'[Dta.CONF]))
Liberado Acumulado = CALCULATE(SUM('IW39 Filtrada'[Custos tot.plan]); FILTER(ALLSELECTED('IW39 Filtrada'); 'IW39 Filtrada'[Liberação real] <= MAX('IW39 Filtrada'[Liberação real] )); USERELATIONSHIP(Datas[Date];'IW39 Filtrada'[Liberação real]))
When i try to put this measures on a line graph, one of them is always flat and i can´t seem to understand why. I tried to inactive relationships between the tables but it didn't work.
I bet its something very simple but i need help to correct it.
Thx
Solved! Go to Solution.
Hi @JPQ,
Your formulas should work though the result could be wrong. Please try this formula instead and the demo in the attachment.
Liberado Acumulado new = CALCULATE ( SUM ( 'IW39 Filtrada'[Custos tot.plan] ), FILTER ( ALLSELECTED ( 'Datas'[Date] ), 'Datas'[Date] <= MAX ( 'Datas'[Date] ) ), USERELATIONSHIP ( Datas[Date], 'IW39 Filtrada'[Liberação real] ) )
Best Regards,
Dale
Thx for the tip!
I finally works. The only thing is that it projets the upcoming months.
Thx a lot!
Hi @JPQ,
Your formulas should work though the result could be wrong. Please try this formula instead and the demo in the attachment.
Liberado Acumulado new = CALCULATE ( SUM ( 'IW39 Filtrada'[Custos tot.plan] ), FILTER ( ALLSELECTED ( 'Datas'[Date] ), 'Datas'[Date] <= MAX ( 'Datas'[Date] ) ), USERELATIONSHIP ( Datas[Date], 'IW39 Filtrada'[Liberação real] ) )
Best Regards,
Dale
Thx for the tip!
I finally works. The only thing is that it projets the upcoming months.
Thx a lot!
I'm going to guess here that perhaps USERELATIONSHIP needs to be within the FILTER clause as well? Models like that are generally bad news.
I wonder what would happen if you created 2 additional calendar tables so that you have 1 calendar table that relates to the other two and then each date in your table relates to one of those 2 calendar tables. Then you use the top calendar table date as your axis.
Then you would have all active relationships.
Hi Greg_Deckler,
Thx for the answer. It seems that USERELATIONSHIP can only be apllied to the CALCULTE function.
I tried to set the date hierarchy that you mentioned, but one of the relationships came inactive.
I found out that one way to solve this problem is duplicating the data table and establishing two active relationships to the calendar table. It solves the problem, but i'm not happy with it.
You know what, another thought is that my Time Intelligence The Hard Way "quick measure" might come into play here. You should be able to use that technique without your second relationship. See what you think:
See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
70 |
User | Count |
---|---|
110 | |
96 | |
95 | |
74 | |
71 |