Forum Discussion
Power bi matrix
- Anonymous1 year ago
HI MHTANK ,
What do you mean by import file in power bi?
The sample data on my side has a Date type column named Date, not sure how you configure your data.
Best Regards,
Qi
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi MHTANK,
I have made a simple demo for your reference.
Write a measure and configure the Matrix as below:
Measure = var _period=SELECTEDVALUE('Periods'[Periods])
var _metics=SELECTEDVALUE('Metrics'[Metric])
var _15ddays= CALCULATE(AVERAGE('Table'[Days]), DATEDIFF('Table'[Date],TODAY()-1,DAY)<=15)
var _15dpcs= CALCULATE(count('Table'[Pcs]), DATEDIFF('Table'[Date],TODAY()-1,DAY)<=15)
var _15dvalues= CALCULATE(SUM('Table'[Value]), DATEDIFF('Table'[Date],TODAY()-1,DAY)<=15)
var _1mays= CALCULATE(AVERAGE('Table'[Days]), DATEDIFF('Table'[Date],TODAY()-1,DAY)-1<=30)
var _1mpcs= CALCULATE(count('Table'[Pcs]), DATEDIFF('Table'[Date],TODAY()-1,DAY)-1<=30)
var _1mvalues= CALCULATE(SUM('Table'[Value]), DATEDIFF('Table'[Date],TODAY()-1,DAY)-1<=30)
var _2mays= CALCULATE(AVERAGE('Table'[Days]), DATEDIFF('Table'[Date],TODAY()-1,DAY)-1<=60)
var _2mpcs= CALCULATE(count('Table'[Pcs]), DATEDIFF('Table'[Date],TODAY()-1,DAY)-1<=60)
var _2mvalues= CALCULATE(SUM('Table'[Value]), DATEDIFF('Table'[Date],TODAY()-1,DAY)-1<=60)
return
if(_period="15 days",if(_metics="Days",_15ddays,if(_metics="Pcs",_15dpcs,if(_metics="Value",_15dvalues))),
if(_period="1 month",if(_metics="Days",_1mays,if(_metics="Pcs",_1mpcs,if(_metics="Value",_1mvalues))),
if(_period="2 month",if(_metics="Days",_2mays,if(_metics="Pcs",_2mpcs,if(_metics="Value",_2mvalues))))
))
Best Regards,
Qi
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
- MHTANK1 year ago
Helper III
- When I am direct copy and paste data in power bi "Enter data" then this is work, but when I import file in power bi then this is not working
- Anonymous1 year agoNot applicable
HI MHTANK ,
What do you mean by import file in power bi?
The sample data on my side has a Date type column named Date, not sure how you configure your data.
Best Regards,
Qi
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!- MHTANK1 year ago
Helper III
Import file means file importing via Get Data